in reply to How can I prevent my email from looking like spam?

I guess a big part of the problem is not perl-related.

First you have to setup your mail server correctly, for example ensure that it works properly if the receiving server uses gray listing, sender verification callout and the like.

And then make sure that your $subject and $body don't look like spam.

Why do the spam filter classify your mail as spam? because of the headers? Or because of bayes classification of the text?

  • Comment on Re: How can I prevent my email from looking like spam?

Replies are listed 'Best First'.
Re^2: How can I prevent my email from looking like spam?
by scorpio17 (Canon) on Jan 03, 2008 at 16:46 UTC
    I don't know why. The "To:" field was set to a gmail address for testing. I don't know what algorithm gmail uses to filter spam. I can send an identical email (in terms of subject, body, etc.) from another gmail account, and it goes through okay, some I'm guessing it's something in the header.
      Can you send messages directly from the same machine (i.e., not using the gmail website or any other webmail host) and have it go through OK?

      Pretty much the only time I see anything sent by my Perl flagged as spam is when I'm testing the code on my home workstation, which connects to the internet on an IP address from my ISP's dynamic address pool. Many mail servers are set up to notice that the mail is coming directly from a dynamic IP address rather than going through a "reputable" server and are more inclined to consider it spam as a result. Sending from a static IP address with reverse DNS set up correctly (or using your ISP's outgoing mail server as a relay/"smarthost" if you're not in a position to set up such a server yourself) tends to make that problem go away.