Contact form PHP file not set properly for SMTP email and not sendingSending email in .NET through GmailSend email using the GMail SMTP server from a PHP pageReference — What does this symbol mean in PHP?PHP Contact Form Submitting RandomlyPHP attachment in contact formphp contact form send to specific email depends on user selected optionEmail PHP Contact Form error as random outputContact form sends email but without user inputscontact form php failedContact form email sends, but the message is in the subject
What verb for taking advantage fits in "I don't want to ________ on the friendship"?
Russian equivalents of 能骗就骗 (if you can cheat, then cheat)
Journal standards vs. personal standards
Avoiding repetition when using the "snprintf idiom" to write text
Why wasn't ASCII designed with a contiguous alphanumeric character order?
How do I keep a running total of data in a column in Excel?
Customs and immigration on a USA-UK-Sweden flight itinerary
Why isn't UDP with reliability (implemented at Application layer) a substitute of TCP?
Having to constantly redo everything because I don't know how to do it
What are the children of two Muggle-borns called?
Perform mirror symmetry transformation of 3D model (in OBJ)
Is it advisable to inform the CEO about his brother accessing his office?
What prevents a US state from colonizing a smaller state?
Can I take Amul cottage cheese from India to Netherlands?
How did they film the Invisible Man being invisible in 1933?
Why is my 401k manager recommending me to save more?
Calculus, water poured into a cone: Why is the derivative non-linear?
How to count the number of bytes in a file, grouping the same bytes?
I agreed to cancel a long-planned vacation (with travel costs) due to project deadlines, but now the timeline has all changed again
What was the first science fiction or fantasy multiple choice book?
Why would Dementors torture a Death Eater if they are loyal to Voldemort?
Where to connect the fuse and why?
Dynamic Sql Query - how to add an int to the code?
Do electrons really perform instantaneous quantum leaps?
Contact form PHP file not set properly for SMTP email and not sending
Sending email in .NET through GmailSend email using the GMail SMTP server from a PHP pageReference — What does this symbol mean in PHP?PHP Contact Form Submitting RandomlyPHP attachment in contact formphp contact form send to specific email depends on user selected optionEmail PHP Contact Form error as random outputContact form sends email but without user inputscontact form php failedContact form email sends, but the message is in the subject
I've set up an email form on my site, added the php file, but it won't send the form to my email address. I contacted my webhost and they replied with "You would need to use a script which supports SMTP for sending not sendmail() which is what the current script is using". What does this mean? Have I set up my php file wrong? I've included my php file below. The form is currently hosted here http://www.rockclick.co.uk/contact.htm
<script><?php
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$subject = $_POST['subject'];
header('Content-Type: application/json');
if ($name === '')
print json_encode(array('message' => 'Name cannot be empty', 'code' => 0));
exit();
if ($email === '')
print json_encode(array('message' => 'Email cannot be empty', 'code' => 0));
exit();
else
if (!filter_var($email, FILTER_VALIDATE_EMAIL))
print json_encode(array('message' => 'Email format invalid.', 'code' => 0));
exit();
if ($subject === '')
print json_encode(array('message' => 'Subject cannot be empty', 'code' => 0));
exit();
if ($message === '')
print json_encode(array('message' => 'Message cannot be empty', 'code' => 0));
exit();
$content="From: $name nEmail: $email nMessage: $message";
$recipient = "enquiries@rockclick.co.uk";
$mailheader = "From: $email rn";
mail($recipient, $subject, $content, $mailheader) or die("Error!");
print json_encode(array('message' => 'Email successfully sent!', 'code' => 1));
exit();
?></script>
php smtp contact-form
|
show 3 more comments
I've set up an email form on my site, added the php file, but it won't send the form to my email address. I contacted my webhost and they replied with "You would need to use a script which supports SMTP for sending not sendmail() which is what the current script is using". What does this mean? Have I set up my php file wrong? I've included my php file below. The form is currently hosted here http://www.rockclick.co.uk/contact.htm
<script><?php
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$subject = $_POST['subject'];
header('Content-Type: application/json');
if ($name === '')
print json_encode(array('message' => 'Name cannot be empty', 'code' => 0));
exit();
if ($email === '')
print json_encode(array('message' => 'Email cannot be empty', 'code' => 0));
exit();
else
if (!filter_var($email, FILTER_VALIDATE_EMAIL))
print json_encode(array('message' => 'Email format invalid.', 'code' => 0));
exit();
if ($subject === '')
print json_encode(array('message' => 'Subject cannot be empty', 'code' => 0));
exit();
if ($message === '')
print json_encode(array('message' => 'Message cannot be empty', 'code' => 0));
exit();
$content="From: $name nEmail: $email nMessage: $message";
$recipient = "enquiries@rockclick.co.uk";
$mailheader = "From: $email rn";
mail($recipient, $subject, $content, $mailheader) or die("Error!");
print json_encode(array('message' => 'Email successfully sent!', 'code' => 1));
exit();
?></script>
php smtp contact-form
why use the script tags for php?
– pr1nc3
Mar 25 at 15:47
I thought I had to?
– Jo Tidman
Mar 25 at 15:48
OK I removed the <script> tags but it's still not working!
– Jo Tidman
Mar 25 at 15:51
You would need to use a script which supports SMTP for sending not sendmail() which is what the current script is using
they already told you what the problem is. themail
functions uses the toolsendmail
by default. I'd recommend to use some library for email stuff; e.g. PHPMailer
– kuh-chan
Mar 25 at 15:54
Added an answer to your question. If my explanation is not clear please attach your code that you actually pass the values to the backend so i can explain further.
– pr1nc3
Mar 25 at 15:56
|
show 3 more comments
I've set up an email form on my site, added the php file, but it won't send the form to my email address. I contacted my webhost and they replied with "You would need to use a script which supports SMTP for sending not sendmail() which is what the current script is using". What does this mean? Have I set up my php file wrong? I've included my php file below. The form is currently hosted here http://www.rockclick.co.uk/contact.htm
<script><?php
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$subject = $_POST['subject'];
header('Content-Type: application/json');
if ($name === '')
print json_encode(array('message' => 'Name cannot be empty', 'code' => 0));
exit();
if ($email === '')
print json_encode(array('message' => 'Email cannot be empty', 'code' => 0));
exit();
else
if (!filter_var($email, FILTER_VALIDATE_EMAIL))
print json_encode(array('message' => 'Email format invalid.', 'code' => 0));
exit();
if ($subject === '')
print json_encode(array('message' => 'Subject cannot be empty', 'code' => 0));
exit();
if ($message === '')
print json_encode(array('message' => 'Message cannot be empty', 'code' => 0));
exit();
$content="From: $name nEmail: $email nMessage: $message";
$recipient = "enquiries@rockclick.co.uk";
$mailheader = "From: $email rn";
mail($recipient, $subject, $content, $mailheader) or die("Error!");
print json_encode(array('message' => 'Email successfully sent!', 'code' => 1));
exit();
?></script>
php smtp contact-form
I've set up an email form on my site, added the php file, but it won't send the form to my email address. I contacted my webhost and they replied with "You would need to use a script which supports SMTP for sending not sendmail() which is what the current script is using". What does this mean? Have I set up my php file wrong? I've included my php file below. The form is currently hosted here http://www.rockclick.co.uk/contact.htm
<script><?php
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$subject = $_POST['subject'];
header('Content-Type: application/json');
if ($name === '')
print json_encode(array('message' => 'Name cannot be empty', 'code' => 0));
exit();
if ($email === '')
print json_encode(array('message' => 'Email cannot be empty', 'code' => 0));
exit();
else
if (!filter_var($email, FILTER_VALIDATE_EMAIL))
print json_encode(array('message' => 'Email format invalid.', 'code' => 0));
exit();
if ($subject === '')
print json_encode(array('message' => 'Subject cannot be empty', 'code' => 0));
exit();
if ($message === '')
print json_encode(array('message' => 'Message cannot be empty', 'code' => 0));
exit();
$content="From: $name nEmail: $email nMessage: $message";
$recipient = "enquiries@rockclick.co.uk";
$mailheader = "From: $email rn";
mail($recipient, $subject, $content, $mailheader) or die("Error!");
print json_encode(array('message' => 'Email successfully sent!', 'code' => 1));
exit();
?></script>
php smtp contact-form
php smtp contact-form
asked Mar 25 at 15:44
Jo TidmanJo Tidman
114 bronze badges
114 bronze badges
why use the script tags for php?
– pr1nc3
Mar 25 at 15:47
I thought I had to?
– Jo Tidman
Mar 25 at 15:48
OK I removed the <script> tags but it's still not working!
– Jo Tidman
Mar 25 at 15:51
You would need to use a script which supports SMTP for sending not sendmail() which is what the current script is using
they already told you what the problem is. themail
functions uses the toolsendmail
by default. I'd recommend to use some library for email stuff; e.g. PHPMailer
– kuh-chan
Mar 25 at 15:54
Added an answer to your question. If my explanation is not clear please attach your code that you actually pass the values to the backend so i can explain further.
– pr1nc3
Mar 25 at 15:56
|
show 3 more comments
why use the script tags for php?
– pr1nc3
Mar 25 at 15:47
I thought I had to?
– Jo Tidman
Mar 25 at 15:48
OK I removed the <script> tags but it's still not working!
– Jo Tidman
Mar 25 at 15:51
You would need to use a script which supports SMTP for sending not sendmail() which is what the current script is using
they already told you what the problem is. themail
functions uses the toolsendmail
by default. I'd recommend to use some library for email stuff; e.g. PHPMailer
– kuh-chan
Mar 25 at 15:54
Added an answer to your question. If my explanation is not clear please attach your code that you actually pass the values to the backend so i can explain further.
– pr1nc3
Mar 25 at 15:56
why use the script tags for php?
– pr1nc3
Mar 25 at 15:47
why use the script tags for php?
– pr1nc3
Mar 25 at 15:47
I thought I had to?
– Jo Tidman
Mar 25 at 15:48
I thought I had to?
– Jo Tidman
Mar 25 at 15:48
OK I removed the <script> tags but it's still not working!
– Jo Tidman
Mar 25 at 15:51
OK I removed the <script> tags but it's still not working!
– Jo Tidman
Mar 25 at 15:51
You would need to use a script which supports SMTP for sending not sendmail() which is what the current script is using
they already told you what the problem is. the mail
functions uses the tool sendmail
by default. I'd recommend to use some library for email stuff; e.g. PHPMailer– kuh-chan
Mar 25 at 15:54
You would need to use a script which supports SMTP for sending not sendmail() which is what the current script is using
they already told you what the problem is. the mail
functions uses the tool sendmail
by default. I'd recommend to use some library for email stuff; e.g. PHPMailer– kuh-chan
Mar 25 at 15:54
Added an answer to your question. If my explanation is not clear please attach your code that you actually pass the values to the backend so i can explain further.
– pr1nc3
Mar 25 at 15:56
Added an answer to your question. If my explanation is not clear please attach your code that you actually pass the values to the backend so i can explain further.
– pr1nc3
Mar 25 at 15:56
|
show 3 more comments
1 Answer
1
active
oldest
votes
I wasn't able to get this to work in the end so gave up and removed the form completely. It appears my web hosting doesn't support email forms.
If anyone has a working email form which sends an email to a gmail address then please feel free to post it here! I googled and have literally spent all day on it and it's beaten me.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55341550%2fcontact-form-php-file-not-set-properly-for-smtp-email-and-not-sending%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I wasn't able to get this to work in the end so gave up and removed the form completely. It appears my web hosting doesn't support email forms.
If anyone has a working email form which sends an email to a gmail address then please feel free to post it here! I googled and have literally spent all day on it and it's beaten me.
add a comment |
I wasn't able to get this to work in the end so gave up and removed the form completely. It appears my web hosting doesn't support email forms.
If anyone has a working email form which sends an email to a gmail address then please feel free to post it here! I googled and have literally spent all day on it and it's beaten me.
add a comment |
I wasn't able to get this to work in the end so gave up and removed the form completely. It appears my web hosting doesn't support email forms.
If anyone has a working email form which sends an email to a gmail address then please feel free to post it here! I googled and have literally spent all day on it and it's beaten me.
I wasn't able to get this to work in the end so gave up and removed the form completely. It appears my web hosting doesn't support email forms.
If anyone has a working email form which sends an email to a gmail address then please feel free to post it here! I googled and have literally spent all day on it and it's beaten me.
answered Mar 25 at 19:36
Jo TidmanJo Tidman
114 bronze badges
114 bronze badges
add a comment |
add a comment |
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55341550%2fcontact-form-php-file-not-set-properly-for-smtp-email-and-not-sending%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
why use the script tags for php?
– pr1nc3
Mar 25 at 15:47
I thought I had to?
– Jo Tidman
Mar 25 at 15:48
OK I removed the <script> tags but it's still not working!
– Jo Tidman
Mar 25 at 15:51
You would need to use a script which supports SMTP for sending not sendmail() which is what the current script is using
they already told you what the problem is. themail
functions uses the toolsendmail
by default. I'd recommend to use some library for email stuff; e.g. PHPMailer– kuh-chan
Mar 25 at 15:54
Added an answer to your question. If my explanation is not clear please attach your code that you actually pass the values to the backend so i can explain further.
– pr1nc3
Mar 25 at 15:56