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.

I thought it was something to do with the sender's email - like if you have 'admin' or 'anonymous' in the sender's email (admin@mysite.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...

sub notify { my ($recipient, $subject, $message) = @_; my $sender = q~"Mailer" <kiat@starhub.com>~; use Mail::Sendmail; unshift @{$Mail::Sendmail::mailcfg{'smtp'}} ,'smtp.somesite.com'; my %mail = ( To => $recipient, From => $sender, Subject => $subject, Message => $message, ); sendmail(%mail) or die $Mail::Sendmail::error; }
Is anything amiss?

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 :)


In reply to perl script to send email... by kiat

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.