Quantcast
Channel: Active questions tagged email - Stack Overflow
Viewing all articles
Browse latest Browse all 29925

mail send message display but mail is not coming [duplicate]

$
0
0

i have sendnewmail function using it send mail,in mail message is send message dispaly but in gmail its not coming ,this is the code

function sendnewmail($msgnew,$emailidnew,$subjectnew){
   require_once("class.phpmailer.php");
      require_once("class.smtp.php");
         $mail = new PHPMailer();
      $mail->IsSMTP();     // set mailer to use SMTP
      $mail->Host = "mail.domain.com"; // specify main and backup server
      $mail->SMTPAuth = true;     // turn on SMTP authentication
      $mail->Username ="user";  // SMTP username
      $mail->Password ="password"; // SMTP password
      $mail->From = "abcds@gmail.com";
      $mail->FromName = "name";
      $mail->AddAddress($emailidnew,"sudeshna");
      $mail->WordWrap = 50;                                 // set word wrap to 50 characters
      $mail->IsHTML(true);                                  // set email format to HTML
          $mail->Subject = $subjectnew;
      $mail->Body    = $msgnew;
          if(!$mail->Send())      {
        echo "Message could not be sent. <p>";
         echo "Mailer Error: " . $mail->ErrorInfo;
         exit;
  }else{
          echo 'Message send ok';
      }
}
$htmldetails ="Welcome to World";
$email = "abc@gmail.com";
$subject = "Sample welcome message";
sendnewmail($htmldetails,$email,$subject);




Viewing all articles
Browse latest Browse all 29925

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>