Help me in sending Email

Discussion in 'Scripts, 3rd Party Apps, and Programming' started by Nahid_hossain, Oct 22, 2008.

  1. Nahid_hossain

    Nahid_hossain New Member

    Hello I wrote a php script that sends email but the problem is that the email goes to spam folder. Please help me sending email directly in inbox.

    PHP:

    {


               
                
    # -=-=-=- MIME BOUNDARY

                
    $mime_boundary $sitename.md5(time());

                
    # -=-=-=- MAIL HEADERS

                
    $to $email;
                
    $subject $subj;

                
    $headers "From: ".$sitename." Email <users@".$sitename.">\n";
                
    $headers .= "Reply-To: admin@7wap.mobi <".$semail.">\n";
                
    $headers .= "MIME-Version: 1.0\n";
                
    $headers .= "Content-Type: multipart/alternative; boundary=\"$mime_boundary\"\n";

                
    # -=-=-=- HTML EMAIL PART

                
    $message .= "--$mime_boundary\n";
                
    $message .= "Content-Type: text/html; charset=UTF-8\n";
                
    $message .= "Content-Transfer-Encoding: 8bit\n\n";

                
    $message .= "<html>\n";
                
    $message .= "<body style=\"font-family:Comic Sans Ms, Verdana, Geneva, sans-serif; font-size:14px; color:#666666;\">\n";
                
    $message .= $msg;
                
    $message .= "<br>\n\n";
                
    $message .= "<br>\n";
                
    $message .= "<br>\n\n";
                
    $message .= "<br>\n\n";
                
    $message .= "<br>\n\n";
                
    $message .= "<div style=\"color:blue; font-family: Arial, Tahoma; font-size: 90%;\">This mail is sent by a user known as from mobile community 7wap.mobi<br/>";
                
    $message .= "You can join this community and keep in touch by registering here <a href=\"http://7wap.mobi\">7wap.mobi</a><br/>";
                
    $message .= "</body>\n";
                
    $message .= "</html>\n";

                
    # -=-=-=- FINAL BOUNDARY

                
    $message .= "--$mime_boundary--\n\n";

                
    # -=-=-=- SEND MAIL

                
    $mail_sent = @mail$to$subject$message$headers );
                echo 
    $mail_sent "Mail has been sent to destination<br/>" "Mail sending failed, Try again later<br/>";



          }

    Last edited: Oct 22, 2008
  2. xPlozion

    xPlozion New Member

    take a look at http://www.php.net/mail . there's some information in there about how to avoid being placed into the spam filters, but it's not full-proof...
    Last edited: Oct 23, 2008

Share This Page