5 ms·
So You'd Like to Send Some Email (Through Code)
- IgorPartola 16y agoAlso, by default in PHP e-mail subjects and other headers containing non-ASCII chars will not be properly encoded. Here's my way of getting things to work: http://igorpartola.com/web-development/proper-way-to-send-e-mail-from-php http://igorpartola.com/web-development/proper-way-to-send-e-...
- wbond 16y agoIf you are sending mail with PHP and have UTF-8 content in the subject, recipient name or body, the fEmail class (http://flourishlib.com/fEmail http://flourishlib.com/fEmail) can handle it all. It supports most common email usage patterns, including HTML content, attachments, S/MIME and sending via SMTP with or without authentication. It doesn't require any non-standard PHP extensions unless you want to use S/MIME, in which case it requires openssl.
- dedward 16y agoWhat you are describing isn't a code problem, but an infrastructure one - a useful network has an MTA for just such outgoing mails, with all the anti-spam bases covered. All the various applications and servers that need to send mail will smarthost to that.
- lazyant 16y agoThis is all fine but what he's talking about is server and DNS configuration, not "There's a bug in this code, though. Do you see it?"
- javery 16y agoOr just use one of the many services that solves these problems for you, like http://authsmtp.com http://authsmtp.com, http://sendgrid.com http://sendgrid.com, http://postmarkapp.com http://postmarkapp.com.
- sorbits 16y agoSome of us like to be in control of our data and/or not pay others for what is essentially free. Also, I am not sure how third party email sending services can avoid having me setup a SPF record — as for the PTR record, it’s a good thing to have even if you do not plan to use the IP for sending emails.
- netcan 16y agoEmail that's hard is free. Email made easy costs something.
- goodmitton 16y agoSending emails has always been a problem for me. The email either gets placed in their spam box (people with aol and yahoo) or the email never arrive there at all (people with comcast and sbc emails). Does anyone have more additional information on how to fix this?
- heyjonboy 16y agoComcast requires that the sending address be a real mailbox on the server pointed to by your domain's MX records -- a catch-all address doesn't cut it. When in doubt, check the logs from your mail server.
- timmorgan 16y agoThe first I've heard of SPF being antiquated. I always configure a SPF record first just because it's so darned easy.
- mikemccabe 16y agoIf you use squirrelmail, you can send messages with wget. This avoids many anti-spam and configuration issues. wget --save-cookies cookies.txt --keep-session-cookies --post-data 'login_username=username&secretkey=password' http://webmail.server.com/src/redirect.php http://webmail.server.com/src/redirect.php wget --load-cookies cookies.txt --post-data 'body=body here&send_to=recipient%40wherever.com&subject=subject here&send=1' http://webmail.server.com/src/compose.php http://webmail.server.com/src/compose.php For a bit more, see: http://mikemccabe.wordpress.com/2007/08/07/sending-email-with-squirrelmail-via-wget/ http://mikemccabe.wordpress.com/2007/08/07/sending-email-wit...
- aymeric 16y agoI read some people use the Google SMTP server to send their emails (when they use Google Apps for your domain). What would be the benefits for me to use MailChimp / AuthSmtp / SendGrid / PostMark? Where do I get the best chances to have my emails reach destination? Thanks