954,561 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Semi-automated email script

I'm making a site for a guy, and he needs a way to email all his customers with a single form to save time and be more efficient. I got the compose page done. But in the past, from my experience, when I sent myself emails generated from sendmail, some email services didn't accept them. They were blocked, didn't even make it to bulk or junk mail folders. This was more than likely because I used a bogus email from address. He has a host account registered, with email addresses to use for the site. But how would I integrate those into a PHP script? Wouldn't I still have to hard code an email address into the sendmail form? How would it know it's real, and not bogus?

I am going to put this into a loop, so that for each customer record that is queried in sequence, an email is sent to their email address. Pretty straightforward.

Thanks in advance.

Diode
Junior Poster in Training
70 posts since Jan 2005
Reputation Points: 50
Solved Threads: 0
 

I use the class.phpmailer.php . It will add all the headers for you and will work for both plain text and html email. It works for hotmail, yahoo, gmail, and many others.

buddylee17
Practically a Master Poster
697 posts since Nov 2007
Reputation Points: 232
Solved Threads: 137
 

I'm making a site for a guy, and he needs a way to email all his customers with a single form to save time and be more efficient. I got the compose page done. But in the past, from my experience, when I sent myself emails generated from sendmail, some email services didn't accept them. They were blocked, didn't even make it to bulk or junk mail folders. This was more than likely because I used a bogus email from address. He has a host account registered, with email addresses to use for the site. But how would I integrate those into a PHP script? Wouldn't I still have to hard code an email address into the sendmail form? How would it know it's real, and not bogus?

I am going to put this into a loop, so that for each customer record that is queried in sequence, an email is sent to their email address. Pretty straightforward.

Thanks in advance.

What function are you using to send email.
You will have to hardcode the sender email address into that function since like you said, you need a valid sender email.
Some Mail Transfer Agents (MTAs) will try to validate sender email before accepting email or callback later for verification. Basically, if you have a valid sender email, then MTA responsible for that address will take care of any validation needed by the remote MTA for which the email is being delivered.

digital-ether
Nearly a Posting Virtuoso
Moderator
1,293 posts since Sep 2005
Reputation Points: 461
Solved Threads: 101
 
What function are you using to send email. You will have to hardcode the sender email address into that function since like you said, you need a valid sender email. Some Mail Transfer Agents (MTAs) will try to validate sender email before accepting email or callback later for verification. Basically, if you have a valid sender email, then MTA responsible for that address will take care of any validation needed by the remote MTA for which the email is being delivered.

Thanks. I was going to use mail().

Diode
Junior Poster in Training
70 posts since Jan 2005
Reputation Points: 50
Solved Threads: 0
 

It will go in spam box for sure.

ithelp
Nearly a Posting Maven
Banned
2,230 posts since May 2006
Reputation Points: 769
Solved Threads: 128
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You