SitePoint Sponsor

User Tag List

Results 1 to 14 of 14
  1. #1
    SitePoint Wizard Busch's Avatar
    Join Date
    Jan 2004
    Posts
    1,072
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    the "from" field in mail()

    Sometimes mail coming from my server ends up in people's bulk/ spam folder. i was wondering if i set the "from" field in my mail() script to my yahoo address (which seems more reliable) if i would have better luck getting the email to the inbox.

    my guess is no, otherwise most spammers would do it, but i just want to check.

    thanks
    eric

  2. #2
    SitePoint Enthusiast
    Join Date
    Apr 2005
    Posts
    83
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What is the From address set to now? The from address needs to be a valid email address as most mail systems will verify the sender before forwarding mail.

  3. #3
    SitePoint Wizard Busch's Avatar
    Join Date
    Jan 2004
    Posts
    1,072
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    will it check the email address against the domain name of the script that sent it?

  4. #4
    SitePoint Evangelist djdykes's Avatar
    Join Date
    Feb 2005
    Location
    Chester, Cheshire
    Posts
    566
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the code to change the from field is

    PHP Code:

    $from 
    "From: whatever@whatever.com\r\n";

    mail $to $subject$message$from ); 
    if you do not have a from address it generally adds the host's domain to the ends of the address...

  5. #5
    SitePoint Wizard Busch's Avatar
    Join Date
    Jan 2004
    Posts
    1,072
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I know how to do it. That is not the issue. I guess my first post want very clear. so i'll try to rephrase what i need.

    basically, most email that i send (either generated by a script or comes from my email client) usually ends up in the recipient's bulk/spam folder. but when i email someone with my yahoo account (via yahoo.com) the mail gets to the recipient's inbox almost all the time.

    so my question, if i set the $from portion of the email to me @yahoo.com will my chances of getting the email to the recipient's inbox be better?

    i hope that makes sense :/

  6. #6
    SitePoint Wizard Defender1's Avatar
    Join Date
    Apr 2001
    Location
    My Computer
    Posts
    2,808
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It may be the content and not the From field that's the culprit.
    In today's anti-spam world, there's lots of filters that'll sorta based on subject & content. This may be your problem.
    Defender's Designs
    I'm Getting Married!

    Not-so-patiently awaiting Harry Potter Book 7 *sigh*

  7. #7
    SitePoint Evangelist djdykes's Avatar
    Join Date
    Feb 2005
    Location
    Chester, Cheshire
    Posts
    566
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    my recommendation would be to try and avoid sending HTML emails 2 reasons...

    1) they're big and may be rejected/filtered by certain mail clients This is unlikely but still a vote against them.

    2) not all clients can read/view html email...this may lead to these mails being filtered out. All mail clients can display plain text mails.

    2a) they're harder to do, need more headers etc...

  8. #8
    SitePoint Wizard Busch's Avatar
    Join Date
    Jan 2004
    Posts
    1,072
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by djdykes
    my recommendation would be to try and avoid sending HTML emails 2 reasons...

    1) they're big and may be rejected/filtered by certain mail clients This is unlikely but still a vote against them.

    2) not all clients can read/view html email...this may lead to these mails being filtered out. All mail clients can display plain text mails.

    2a) they're harder to do, need more headers etc...
    its not an html email. its just plain text. i chose to use plain text for the reasons you mentioned.

  9. #9
    Are You There? KDesigns's Avatar
    Join Date
    Oct 2003
    Location
    Your Monitor
    Posts
    1,147
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't believe (although I could be wrong) that the spam filter goes off of the domain but the IP of the server from which it is sent.
    ChooseDaily.com - Follow on Twitter
    Top Resources for Web Designers and Developers Every Day!

  10. #10
    SitePoint Enthusiast
    Join Date
    Apr 2005
    Posts
    83
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Spam filtering by domain is very widely used. In fact, more so than IP based filtering. Because of all the filtering out there it is almost impossible to make sure every email gets delivered. Also, some mail servers will only accept a certain amount of emails from a source during a specific time window. So if you are sending potentially several hundred emails within a short period of time to the same mail server (e.g. mail.earthlink.net) it may start blocking.

    To answer your question about using your yahoo address as the from, i would say yes; you may have better luck getting mail delivered. This is because the chances of a mail server blocking the yahoo domain is very unlikely and if they do block it will be from the specific address. At one point, I had a PHP script randomly generate yahoo addresses to use as the From for sending email and they were always delivered.

  11. #11
    SitePoint Wizard Busch's Avatar
    Join Date
    Jan 2004
    Posts
    1,072
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by pworley
    Spam filtering by domain is very widely used. In fact, more so than IP based filtering. Because of all the filtering out there it is almost impossible to make sure every email gets delivered. Also, some mail servers will only accept a certain amount of emails from a source during a specific time window. So if you are sending potentially several hundred emails within a short period of time to the same mail server (e.g. mail.earthlink.net) it may start blocking.

    To answer your question about using your yahoo address as the from, i would say yes; you may have better luck getting mail delivered. This is because the chances of a mail server blocking the yahoo domain is very unlikely and if they do block it will be from the specific address. At one point, I had a PHP script randomly generate yahoo addresses to use as the From for sending email and they were always delivered.
    im surprised and happy to know that it worked for you. i think i will change the address and see what happens. there shouldnt be any issue of the number of emails generated in a certain time because the script isnt run that often and only sent to 6 email addresses at most at when it is run.

    thanks
    eric

  12. #12
    SitePoint Evangelist djdykes's Avatar
    Join Date
    Feb 2005
    Location
    Chester, Cheshire
    Posts
    566
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Busch
    its not an html email. its just plain text. i chose to use plain text for the reasons you mentioned.
    yeah sorry bout that, it was late!!!

  13. #13
    Are You There? KDesigns's Avatar
    Join Date
    Oct 2003
    Location
    Your Monitor
    Posts
    1,147
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by pworley
    Spam filtering by domain is very widely used. In fact, more so than IP based filtering.
    Thanks for clearing that up for me!
    ChooseDaily.com - Follow on Twitter
    Top Resources for Web Designers and Developers Every Day!

  14. #14
    SitePoint Wizard Busch's Avatar
    Join Date
    Jan 2004
    Posts
    1,072
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok, this is interesting. i have one more question and i'll give more detail about what i am doing.

    I have an ecard site. It would be nice if most of the cards sent actually arrived into the inbox of the recipient. I know that sometimes mail sent from my server (not sure if its a server issue or an IP issue) does not arrive in the recipient's inbox because their spam filter does not like me. Keep in mind, these are just emails i type to my friends and family via Entourage.

    So what if, when the ecard site sends mail(), i used the sender's email address as the "From:" parameter of the mail() function. That way the recipient's email filters will recognize the sender's address and let the email through to the inbox.

    Is this a good idea? Might it have negative ramifications?

    Thanks
    eric


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •