• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Website with contact form: not sending the email.

Explorer ,
Apr 12, 2019 Apr 12, 2019

Copy link to clipboard

Copied

Hello,

The contact sheet on my website is not sending emails.  I had contacted HostGator, thought it could be something there side, but they said:

"It is usually you using PHPMail that sends the email without the spf record and as such its blocked.  I highly recommend you should use SMTP to send the email out instead of PHPMailer"

I am not sure how to do this and he did not know and said that I should google it.

Would any one know what I will need to do?  My website is [personal infos deleted by moderator].

Thank you.

Sheila

Views

3.2K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 12, 2019 Apr 12, 2019

Copy link to clipboard

Copied

PHPmailer is a library that helps you to construct the mail from A to Z, SMTP is also a library (beside the fact that it is a protocol) that helps you to send the mail.

both are really easy to use, and go hand in hand,

you should find everything that you need on the git hub

GitHub - PHPMailer/PHPMailer: The classic email sending library for PHP

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 12, 2019 Apr 12, 2019

Copy link to clipboard

Copied

by the way if you have trouble caused by SPF, think to open the SMTP autentification and use an URL that has the same domain than yours

$mail->SMTPAuth   = true

$mail->Username   = [personal infos deleted by moderator]

$mail->Password   = 'XXXXXXXXX';

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 12, 2019 Apr 12, 2019

Copy link to clipboard

Copied

Thank you, I will have a look at GitiHub plus keep in mind the code that you gave below too.  I am learning on the job, so to say, so all the help I get is most welcomed.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 12, 2019 Apr 12, 2019

Copy link to clipboard

Copied

please don't hesitate, the github is full of samples

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 12, 2019 Apr 12, 2019

Copy link to clipboard

Copied

sheilaxs726  wrote

Thank you, I will have a look at GitiHub plus keep in mind the code that you gave below too.  I am learning on the job, so to say, so all the help I get is most welcomed.

I think you will find anything on Github beyond your pay-grade and likely difficult to understand and set up, its not meant for newbies but for geekies that understand coding terminology. Its highly likely that you will jump back in fear when it mentions setting up phpMailer via your computer terminal - it buries the much simpler zip download workflow as don't forget geekies tend to want to make the job much harder than it actually is.

Post back if you get stuck and I'm sure someone will provide you with more help.

Make sure your host doesnt support the php mail() function as that is far easier to set up and for a simple feedback form which requires no attachments its ideal.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 12, 2019 Apr 12, 2019

Copy link to clipboard

Copied

Sending e-mail from one's server is a lot more complicated now than it used to be.   Almost every web host I deal with is sending mail with SMTP, not PHP mail() function.   And if your mail doesn't contain proper identifying headers, it's often flagged & rejected as spam regardless of whether or not  it contains spam.  This makes it doubly hard for average coders to get mail through to Gmail, Hotmail and other web based e-mail systems.   PHPMailer may seem like overkill for some situations but it works.

Nancy O'Shea— Product User, Community Expert & Moderator
Alt-Web Design & Publishing ~ Web : Print : Graphics : Media

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 12, 2019 Apr 12, 2019

Copy link to clipboard

Copied

https://forums.adobe.com/people/Nancy+OShea  wrote

Sending e-mail from one's server is a lot more complicated now than it used to be.   Almost every web host I deal with is sending mail with SMTP, not PHP mail() function.   And if your mail doesn't contain proper identifying headers, it's often flagged & rejected as spam regardless of whether or not  it contains spam.  This makes it doubly hard for average coders to get mail through to Gmail, Hotmail and other web based e-mail systems.   PHPMailer may seem like overkill for some situations but it works.

I really couldn't give a hoot about Gmail, Hotmail etc. I deal with professional email accounts, not some mickey-mouse personal email addresses. No serious client has a business address at Gmail or Hotmail and all of my hosts have the mail() function available to use.

It doesnt have to be complicated, developers and some hosts make it more complicated just about like everything else web-related these days.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 12, 2019 Apr 12, 2019

Copy link to clipboard

Copied

All hosts I deal with have PHP mail() fuinction too. But it's getting so it won't work without SMTP authentication.

osgood_  wrote

I really couldn't give a hoot about Gmail, Hotmail etc. I deal with professional email accounts, not some mickey-mouse personal email addresses.

You've missed the point entirely.  I am not talking only about e-mail sent to site owners. What about confirmation e-mails sent to customers who use Gmail, Hotmail, etc...?  I have several auto-generated e-mails that my server sends to customers at checkout.   Bounced e-mails are unacceptable.

Nancy O'Shea— Product User, Community Expert & Moderator
Alt-Web Design & Publishing ~ Web : Print : Graphics : Media

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 13, 2019 Apr 13, 2019

Copy link to clipboard

Copied

I havent had any issues with Gmail and the php mail function so far. I actually do have a Gmail test account for the reason you state. Infact Gmail works better than trying to get  form emails sent back to a business email address in some circumstances particularly in cases where the client has an internal email server installed or have moved to cloud email

There are a lot of dodgy companies installing email servers with no skill to configure them correctly to receive email from a website feedback form. The issues l generally get concerning client emails going astray can usually be associated with one of these contraptions but of course the installer always denies its their problem. Once l test the mail gets distributed correctly from the remote email server  to a Gmail account or my own business email, without hitting the box they have installed, they cant deny it and have to put ot right. WOW everyone else is getting the feedback apart from the email address it should be going back to, go figure.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 13, 2019 Apr 13, 2019

Copy link to clipboard

Copied

I have GatorHost and they said I need to set up SMTP, I have used PHP mail and it just keeps getting blocked.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 14, 2019 Apr 14, 2019

Copy link to clipboard

Copied

sheilaxs726  a écrit

I have GatorHost and they said I need to set up SMTP, I have used PHP mail and it just keeps getting blocked.

More and more servers are reinforcing their protection policies in case of email spoofing in order to limit SPAM.

in fact, when a server sends a message through a messaging function linked to a third language (PHP for example), there is no indication whether it is a usurpation (fraudulent mail) or a real sending of a message... so the sender server will identify itself with its DNS relating the IP addresses authorized to send messages, and especially with an authentication.

this information is not contained in the message header but in the envelope of the mail at the SMTP level. therefore, it is necessary to use a class that allows this type of operation. The simple mail() function, which was very effective until now, does not provide this functionality and therefore becomes ineffective.

hence the remark of your host.

if you have a problem using these tools, reassure yourself that it is very simple... if the examples provided on the github are not clear to you, do not hesitate to come back to us, we will help you to get through this step.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 14, 2019 Apr 14, 2019

Copy link to clipboard

Copied

https://forums.adobe.com/people/B+i+r+n+o+u  wrote

sheilaxs726   a écrit

I have GatorHost and they said I need to set up SMTP, I have used PHP mail and it just keeps getting blocked.


hence the remark of your host.

Apart from the host actually does support the simple mail() function:

How to use sendmail with PHP « HostGator.com Support Portal

BUT not on their Window servers hence my post assuming the OPs website must be hosted on a Windows server IF the host provides information relating to SMTP in which case they advice using their SMTP workflow processing script.

https://support.hostgator.com/articles/specialized-help/email/miscellaneous-email-information/steps-...

Edited:

Having checked out the server info of the website in question it is hosted on a nginx/1.14.1 server so it should support the simple php mail() function, according to the information from the host website...........setting it up or the phpMailer alternative is another story for most who are new to retrieving information from a form.

I'd start by sending a very simple test through first to make sure everything is working then move onto the process of retrieving and securing the form input information.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 16, 2019 Apr 16, 2019

Copy link to clipboard

Copied

Thank you everyone for your advice.  I really appreciate your time and expertise.

I had contacted HostGator and they said that it is a Linux server and to check out their website for help or hire a developer.

I did find some code for a contact form on their website, it was interesting to slice and dice it into something a little more presentable.  It is not exactly what I wanted, as I really liked the first contact form that I had put together via a youtube tutorial, but I'd rather have one that works, so all in all I am pretty happy that I got my website up and running.

Thank you again.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 16, 2019 Apr 16, 2019

Copy link to clipboard

Copied

Thank you very much.

It is a great source of information and now that I have my site up and running, I now have more time to read and absorb it.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 18, 2019 Apr 18, 2019

Copy link to clipboard

Copied

don't forget to extend your reading to SPF which in fact is the cause behind the sending mail error, and the need of using SMTP

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 18, 2019 Apr 18, 2019

Copy link to clipboard

Copied

https://forums.adobe.com/people/B+i+r+n+o+u  wrote

don't forget to extend your reading to SPF which in fact is the cause behind the sending mail error, and the need of using SMTP

Doesnt look as though SMTP is being used at all if the link to the perl processing script is anything to go by - formmail.pl - thats as old as Ben is.

Using the email recipent directly within the form:

<input type="hidden" name="recipient" value="shXXX@shXXXXXasXXXXXhaefer.XXXXX">

You can't tell em though!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 18, 2019 Apr 18, 2019

Copy link to clipboard

Copied

please try to reduce unnecessary confusion and amalgams in between posts... since I started publishing on this thread, I only mentioned PHPMailer, SMTP and SPF. I have never mentioned or alluded to any PERL scripts whatsoever to be used

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 18, 2019 Apr 18, 2019

Copy link to clipboard

Copied

https://forums.adobe.com/people/B+i+r+n+o+u  wrote

please try to reduce unnecessary confusion and amalgams in between posts... since I started publishing on this thread, I only mentioned PHPMailer, SMTP and SPF. I have never mentioned or alluded to any PERL scripts whatsoever to be used

Then keep up to speed with what the OP is actually using to process their form, its currently NOT phpMailer. So either provide some useful help rather than posting a link to Github, which a novice won't understand, or shut up please.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 18, 2019 Apr 18, 2019

Copy link to clipboard

Copied

osgood_  a écrit

Then keep up to speed with what the OP is actually using to process their form, its currently NOT phpMailer. So either provide some useful help rather than posting a link to Github, which a novice won't understand, or shut up please.

I am sorry to see that after being absent from this forum a few weeks old habits do not change... thank you for the kindness of your comments.... I really appreciate it......

for your information, read message OP #1

sheilaxs726  a écrit

"It is usually you using PHPMail that sends the email without the spf record and as such its blocked.  I highly recommend you should use SMTP to send the email out instead of PHPMailer"

that was the main purpose of my answer... PHPMailer, SMTP and SPF... so I think that the answer was appropriate...

now to the fact of pointing at a github... if you carreffluy read the content you'll find a full folder of samples ready to be used

PHPMailer/examples at master · PHPMailer/PHPMailer · GitHub

and finally before concluding I have always added in my answers

https://forums.adobe.com/people/B+i+r+n+o+u  a écrit

if you have a problem using these tools, reassure yourself that it is very simple... if the examples provided on the github are not clear to you, do not hesitate to come back to us, we will help you to get through this step.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 18, 2019 Apr 18, 2019

Copy link to clipboard

Copied

https://forums.adobe.com/people/B+i+r+n+o+u  wrote

I am sorry to see that after being absent from this forum a few weeks old habits do not change... thank you for the kindness of your comments.... I really appreciate it......

for your information, read message OP #1

Then talk some sense not just what you want others to hear. All I see you and others in this forum ever do is post url links to pages which are above and beyond the OPs pay-grade, that's not being helpful at all.

https://forums.adobe.com/people/B+i+r+n+o+u  wrote

"It is usually you using PHPMail that sends the email without the spf record and as such its blocked.  I highly recommend you should use SMTP to send the email out instead of PHPMailer"

That message was from the OPs host company, not the OP. At that point the OP had no idea what php mailer was, wasnt even considering using it and probably didnt need to use it. That was a host just being unhelpful much like most hosts, just tell them any old rubbish. I did some research, yes research unlike the host. The host clearly supports the php mail() according to the information on its website. Much simpler to set up, pretty helpful information I would say to a novice out of their depth. Is it any wonder you court the responses I fire at you at times. Every one seems to be cranky.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 18, 2019 Apr 18, 2019

Copy link to clipboard

Copied

osgood_  a écrit


The host clearly supports the php mail() according to the information on its website. Much simpler to set up,

yep , but as said before mail() deosn't handle SMTP and the host clearly specify that SPF was blocking because of that ... so mail() wasn't a way to go

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 18, 2019 Apr 18, 2019

Copy link to clipboard

Copied

https://forums.adobe.com/people/B+i+r+n+o+u  wrote

osgood_   a écrit


The host clearly supports the php mail() according to the information on its website. Much simpler to set up,

yep , but as said before mail() deosn't handle SMTP and the host clearly specify that SPF was blocking because of that ... so mail() wasn't a way to go

It was not clear at any point in post 1 what method the OP was using, if any. At the time of the posted question I looked at the OPs website, there wasnt even a form to be seen, just some input boxes with a button clicking to nowhere.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 18, 2019 Apr 18, 2019

Copy link to clipboard

Copied

osgood_  a écrit

All I see you and others in this forum ever do is post url links to pages which are above and beyond the OPs pay-grade, that's not being helpful at all.

and if it were simply up to them to say that our answers are not useful...?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 18, 2019 Apr 18, 2019

Copy link to clipboard

Copied

https://forums.adobe.com/people/B+i+r+n+o+u  wrote

osgood_   a écrit

All I see you and others in this forum ever do is post url links to pages which are above and beyond the OPs pay-grade, that's not being helpful at all.

and if it were simply up to them to say that our answers are not useful...?

I think I can judge by the OPs website if a post to a url with geeky information is going to be of any help to them. Maybe I've been doing this longer than you or maybe you are an eternal optimist, alas I'm not, I live in the real world having experienced most of these problem myself, at some point.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines