SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    Non-Member
    Join Date
    Feb 2008
    Location
    Idaho Falls, Idaho
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    clients not getting there emails

    I am having problems with emails not sending to clients and getting in spam folders. I am using the code below to send the orders to the clients, but some arnt getting the emails. Im having a problem with that. Is there a better way to send emails from my server that Im not aware of? Please let me know thanks.

    mail( "$email", "email title",
    "email body", "From: support@buyblogcomments.com" );

  2. #2
    SitePoint Guru
    Join Date
    Feb 2008
    Posts
    655
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This can be very difficult as different servers think different messages are spam. What headers are included in the email?

  3. #3
    Non-Member
    Join Date
    Feb 2008
    Location
    Idaho Falls, Idaho
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Header? I guess im not using a header. Can you give me an example of a header and then I will google it somemore. Thanks corbyboy

  4. #4
    rajug.replace('Raju Gautam'); bronze trophy Raju Gautam's Avatar
    Join Date
    Oct 2006
    Location
    Kathmandu, Nepal
    Posts
    4,013
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try to see some examples in PHP Manual
    http://www.php.net/manual/en/ref.mail.php

    Also there is neat and clean article in sitepoint as well.
    http://www.sitepoint.com/article/advanced-email-php
    Mistakes are proof that you are trying.....
    ------------------------------------------------------------------------
    PSD to HTML - SlicingArt.com | Personal Blog | ZCE - PHP 5

  5. #5
    Non-Member
    Join Date
    Feb 2008
    Location
    Idaho Falls, Idaho
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks rajug for your reply. I checked out those pages and been working on my coding for the last day. This is what I have and I cant seem to get it to work. I tested each part out but when i put it together it dosent work, maybe you can have a look. thanks

    PHP Code:
    // The message
    $message "blah blah boring \n\n Blog Comments: \n\n $comments";

    // In case any of our lines are larger than 70 characters, we should use wordwrap
    $messaged wordwrap($message60);

    // this is the header.
    $to      '$email';
    $subject 'FINISHED COMMENTS - BuyBlogComments.Com';
    $messagedisplay '$messaged';
    $headers 'From: support@buyblogcomments.com' "\r\n" .
        
    'Reply-To: support@buyblogcomments.com' "\r\n" .
        
    'X-Mailer: PHP/' phpversion();

    // this is the code that actually sends the email
    mail($to$subject$messagedisplay$headers); 
    I dont know wheather its not working for being filters by spam shizz...

  6. #6
    rajug.replace('Raju Gautam'); bronze trophy Raju Gautam's Avatar
    Join Date
    Oct 2006
    Location
    Kathmandu, Nepal
    Posts
    4,013
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try like this once:
    PHP Code:
    // The message
    $message "blah blah boring \n\n Blog Comments: \n\n $comments";

    // In case any of our lines are larger than 70 characters, we should use wordwrap
    $messaged wordwrap($message60);

    // this is the header.
    $to      $email;
    $subject 'FINISHED COMMENTS - BuyBlogComments.Com';
    $messagedisplay $messaged;
    $headers 'From: support@buyblogcomments.com' "\r\n" .
        
    'Reply-To: support@buyblogcomments.com' "\r\n" .
        
    'X-Mailer: PHP/' phpversion();

    // this is the code that actually sends the email
    mail($to$subject$messagedisplay$headers); 
    BTW, are you testing this script in the local system or in live. If you are testing in local system and you need to configure 2/3 lines in the php.ini file as well. Otherwise if $email variable is holding an email then it must work.
    Mistakes are proof that you are trying.....
    ------------------------------------------------------------------------
    PSD to HTML - SlicingArt.com | Personal Blog | ZCE - PHP 5

  7. #7
    SitePoint Guru
    Join Date
    Feb 2008
    Posts
    655
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For reliable email sending it is worth trying PHPMailer.

    Sending mail on PHP seems to be very hit and miss. It's not sending the email that's a problem. It's getting the email services to accept it as a genuine mail. I don't think there is one specific setting (be it mail header or php.ini configuration) that will guarantee an email will arrive safely in the inbox.

    PHPMailer is definitely your best bet.


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
  •