|Syntactic Confectionery Delight|
perl script to send email...by kiat (Vicar)
|on Mar 23, 2004 at 08:38 UTC||Need Help??|
kiat has asked for the
wisdom of the Perl Monks concerning the following question:
Hi and greetings to all,
This isn't really related to perl per se but perhaps someone here can offer some enlightenment.
I've a perl mailer script (using Sendmail) to email a notification to a specified email address after a form is filled out.
The sending gets through but the trouble is the email is treated as Bulk Mail by Yahoo as well as Hotmail (don't know about other other mail servers). Hence, the risk that the notification gets ignored because it went into Bulk and not Inbox.
I tried this site's Forgot Your Password mailer and the email reached my Yahoo Inbox. I compared that password resend email and the one I'm experimenting and observed they are pretty much the same - subject, from, to are all filled.Is anything amiss?
I thought it was something to do with the sender's email - like if you have 'admin' or 'anonymous' in the sender's email (email@example.com), the email gets treated as junk. But even after changing the sender's email to my personal email, the same thing happens.
I've pasted the code below in case I've missed anything...
Thanks for reading :)
Update 1: Looks like it's the smtp server issue. It seems the email is routed through at least two servers being reaching its destination. I read somewhere that the destination email server recognises that sort of email as Bulk or Junk mail. :(
Update 2 (Solution): I found the offending part of the email that's causing Yahoo to treat it as Bulk instead of a normal email. My original message in that email contains a link for the recipient to click on to confirm his account. When I removed that link from the message, the email went to my Yahoo's Inbox, which is the intended effect. I did a confirmation by putting back the link and sure enough, the email went to Bulk. So that was the mystery :)