PHP mail form doesn’t complete sending e-mail

are you using SMTP configuration for sending your email? try using phpmailer instead. you can download the library from i created my email sending this way:

function send_mail($email, $recipient_name, $message='')

    $mail = new PHPMailer();

    $mail->IsSMTP();                                      // set mailer to use SMTP
    $mail->Host = "";  // specify main and backup server
    $mail->SMTPAuth = true;     // turn on SMTP authentication
    $mail->Username = "myusername";  // SMTP username
    $mail->Password = "p@ssw0rd"; // SMTP password

    $mail->From = "";
    $mail->FromName = "System-Ad";
    $mail->AddAddress($email, $recipient_name);

    $mail->WordWrap = 50;                                 // set word wrap to 50 characters
    $mail->IsHTML(true);                                  // set email format to HTML (true) or plain text (false)

    $mail->Subject = "This is a Sampleenter code here Email";
    $mail->Body    = $message;
    $mail->AltBody = "This is the body in plain text for non-HTML mail clients";    
    $mail->AddEmbeddedImage('images/logo.png', 'logo', 'logo.png');

       echo "Message could not be sent. <p>";
       echo "Mailer Error: " . $mail->ErrorInfo;

    echo "Message has been sent";

(Visited 17 times, 1 visits today)
Reference - What does this error mean in PHP?
How do you parse and process HTML/XML in PHP?



Leave a Reply

Your email address will not be published. Required fields are marked *