OlammieConcept Posted February 4, 2013 Share Posted February 4, 2013 I am trying to send mail using the PHPMailer classes with smtp, i was not getting any error but the mail isn't going. Please find below the code I used. <?php //require("class.phpmailer.php"); include "class.smtp.php"; include "class.phpmailer.php"; $Host = $_POST["smtpUrl"]; // SMTP servers $Username = $_POST["smtpUsername"]; // SMTP password $Password = $_POST["smtpPassword"]; $From = $_POST["fromEmail"]; $FromName = $_POST["from"]; $to = $_POST["to"]; $subject = $_POST["subject"]; $body = $_POST["boduu"]; $bcclist = $_POST["bcc"]; $mail = new PHPMailer(); $mail->IsSMTP(); $mail->Mailer = "smtp"; // send via SMTP $mail->Host = $Host; $mail->SMTPAuth = true; // turn on SMTP authentication $mail->Username = $Username; $mail->Password = $Password; $mail->From = $From; $mail->FromName = $FromName; //Logic for the BCC mail will go here $mail->WordWrap = 50; // set word wrap $mail->Priority = 1; $mail->IsHTML(true); $mail->Subject = $subject; $mail->Body = $body; $mailer->AddAddress($to); foreach($bcclist as $bccer) { $mail->AddBCC($bccer); } if(!$mail->Send()) { echo "Mailer Error: " . $mail->ErrorInfo; } else { echo "The mail has been sent in HTML format. This is inbox confirmed."; } ?> I will appreciate any help provided by you in the house. Thank You in advance. Quote Link to comment https://forums.phpfreaks.com/topic/274007-phpmailer-not-showing-error-but-not-sending-mail/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.