SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Enthusiast
    Join Date
    Dec 2005
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Emails sent through PHP

    I have a script that sends out emails to my customers when I update their order status. The problem is, only about 1/2 of them seem to receive the email. Does anyone know why this could be happening? Is it getting delivered to their spam folder? Is there a way I could prevent that from happening?

    Thanks,
    Kevin

  2. #2
    SitePoint Wizard silver trophy
    Join Date
    Mar 2006
    Posts
    6,132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    its possible its going to thier spam folder etc...
    could be your host too, ive had bad shared hosting before where their email is down half the time.

    its possible your code isnt always sending the email though.
    or that the email is not formed properly, for example maybe you use variables without first checking if they exist, or have an acceptable value.

  3. #3
    SitePoint Addict
    Join Date
    Feb 2003
    Location
    Berlin
    Posts
    370
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you have SPAM-Assassin or anything like that installed, sent an mail to yourself und look, what the header gives you for SPAM-information (about the email sent with your script)

    This SPAM information could look like this:
    X-Spam-Status: Yes, score=6.7 required=5.0 tests=BAYES_99,DNS_FROM_RFC_WHOIS, INVALID_DATE,NA_DOLLARS,NO_REAL_NAME autolearn=no version=3.0.3



    A lot of those email forms are poorly written. The header information is not enough.
    So often you have to add a message id like this:
    $msgid = sprintf("<2000%s.%semail@yourdomain.de>", time(), rand(0, 1000));

    so that the headinformation could look like this:
    $head = "Message-ID:$msgid\n";
    $head .= "From: $from\nX-Mailer: PHP/" . phpversion()."\r\n";
    $head .= "MIME-Version: 1.0\r\n";

    Send your Email:
    mail($emailaddress, $subject, $message, $head);


    Does this help you?
    Fl÷zen

  4. #4
    if ($zee == "Guru") { $zee--;}
    Join Date
    Nov 2005
    Location
    Karachi - Pakistan
    Posts
    1,134
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i

    I want to send email from my PHP Application. At present i m using a FREE PHP Hosting service. But there SMTP and Sendmail is not available.

    Now what i want is that :: IS IT POSSIBLE TO USE SOME FREE ONLINE SMTP HOST / SERVER TO SEND EMAIL FROM MY WEBSITE ???? if yes then plz locate some free SMTP Hosts / Servers from which i can send email from my website (which is uploaded on a free server. )


    thanks ....

  5. #5
    SitePoint Enthusiast
    Join Date
    Dec 2005
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks for the responses

    I do not have spam assassin installed. Is there any other way to get that information? Or do you suggest I just add that info to the header anyways? I have checked my script to make sure that the emails are actually being sent, and they are being sent.

    thanks again for the help

  6. #6
    SitePoint Addict
    Join Date
    Feb 2003
    Location
    Berlin
    Posts
    370
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If a message id is missing in the php script, just add it. I't won't do any harm.
    But check the herder if it looks right. You can google to find out, how a proper id has to look like. The example i gave is a good one
    Try to find somebody, who has a SPAM filter and look what information you can find in the header. Unfortunately I don't know if other filters have an information about spam-possibility in the header...

    Fl÷zen

  7. #7
    SitePoint Enthusiast
    Join Date
    Dec 2005
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks Flozen, I see what you're saying.

    It is missing the MIME version so I added that in there, also my message id is

    "Message-Id: <200603140450.k2E4o64h020940@kernel.apisnetworks.com>"

    When my domain is www.designamosaic.com. Apis networks is my host, so thats where that comes from. Could this be part of the reason its being flagged as spam?

    Thanks again for your help.

  8. #8
    SitePoint Addict
    Join Date
    Feb 2003
    Location
    Berlin
    Posts
    370
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As long as the reverse lookup for kernel.apisnetworks.com returns the same IP as for your domain, it should not be a problem.


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
  •