hello good people. I'm here searching for some good php script to send a mail. I've looked on the internet for a script with some security ( to protect me against spam ). I've made the validation with the jquery validate plugin. works well, but now I've to add some code to send emails. does anyone knows a place with script samples or tutorials? thanks in advance,
use PHP mail() functions. Here $header is an optional argument. You make it mandatory. Put a valid header (for example, the sender email address is from current domain, where the script is hosted), while using PHP mail() function. Your mails won't be detected as spam. For PHP mail() function reference see here: http://php.net/manual/en/function.mail.php http://www.w3schools.com/PHP/php_mail.asp
Who told you that? I'd suggest: http://sourceforge.net/projects/phpmailer/ with the smtp option. I've also heard good things about the following (however never used it myself): http://swiftmailer.org/
I use PHP mail() all the time and even when I mess up and forget the header (or once I forgot the from email), it did not go into spam. I have tried on Gmail, Yahoo and Hotmail.
PHP's mail() is certainly not to be relyed upon, as not in all cases will the email be recieved within the inbox, I've seen many cases where the email's land within the spam/junk folder. Also many host's nowadays have a limit on the usage, (theirfore could prevent sending newsletters etc.. to your members) When it does end up in the inbox, its probably because it fits a certain criteria of the reciepients email provider, such as the server where the email is coming from is reputable (not blacklisted), the email does'nt trigger the spam filter (does'nt contain common words which are within a spam email), the email headers are defined correctly ( http://www.transio.com/content/how-pass-spam-filters-php-mail ) etc.
See, I'm not sure if PHPMailer is using cUrl for both authenticating and sending mails or not, but I realize, you don't need to send mails from PHP script only after smtp authentication. It depends on your requirement. Example? You have a publicly accessible form in your site, which sends mail. Use SMTP for this case. Never allow a real spammer to play around! But, when sending a registration confirmation email (when a successful registration takes place on your site), you don't need an SMTP authentication. AND FOR YOUR QUESTION, "WHO TOLD"... No one told. I tested it and used in practice. If mail() function used with proper header (specifically the From: field of email header should be an email id from the domain, where the current script is hosted), some really strong filters won't block your mails. IT'S A GUARANTEE!!! Not even Gmail, Live, Yahoo, AOL, IN emails, but also no paid mailbox will mark it as spam. A CONDITION IS STILL THERE: Some custom filters of very busy mail ids are configured more cleverly. They filter all emails from a or kind of email ids. They even truncate all emails with a subject like, that contains the term "Newsletter" or "LUCKY WINNER" or "Invitation" etc. So, you always get the option to customize your automated emails. Never use generic keywords in subject; if possible do not use no-reply mail ids (which email ids are not monitored or even do not exist) for sending mails. AND, for sending newsletter, a PHPMailer script can't do a miracle. Never, ever think of sending thousands of mail at a go from your shared or even VPN servers. Your provider seldom allow you to send more than 500-600 mails per hour from these servers. For this use some custom solutions, specially created for sending bulk mails. SMTP authentication is no how related to newsletter sending.ac
One thing I must add here: Remember, if the domain (or the IP, where the domain is hosted) is blacklisted already, nothing can help. Neither mail() function, nor SMTP authentication, nothing will work. Even an email authenticated by a blacklisted SMTP server, will be identified as SPAM. So, please avoid bulk mailing activity from shared or virtual-private environment.
I personally suggest PHPMailer, I have used it and have been sing it for a lot of clients and personal site and it hasn't let me down yet