1

So I had read and do all the solutions given at PHPMAILER Not sending and not giving error , however my mail is still not sent out via my SMTP. I'm using hMailServer 5.4-B1950, sending mail from 'localhost' and here is my code :

require_once('class.phpmailer.php');
$mail = new PHPMailer();

if ($ways=="cashchequesc"){
$_SESSION['youdont'] = "0";

$mail->IsSMTP();                         
$mail->Host     = "localhost";           
//$mail->SMTPAuth   = true;                // out in-case of future use.
$mail->Port       = 25;                  
//$mail->Username   = "deli-pie@gmail.com";  // out cause localhost doesn't seems to need one
//$mail->Password   = "ilovepie1984";         
$mail->From     = ("pie-delivery@pd.com");
$mail->FromName = ("PD-licious Pie");
$mail->AddAddress("piepie314159@gmail.com","PieUser1");
$mail->Subject  = $myusername . "'s Purchases of ". $_SESSION['amount'] ." of XXXX.";
$mail->Body     = $myusername ." has purchased X number of item for total amount of S$"     . $_SESSION["payamount"] . " via CHEQUE/Cash on Collection.";
$mail->WordWrap = 70;
  • UPDATE 16/7/2014 1356H GMT+8 Okay guys. I got it to work locally using hMailServer's Protocol set up and linking it to a gmail account. Now if I want to to go on a remote SMTP server, what should I change?
Community
  • 1
  • 1
ysPhongE
  • 19
  • 3
  • Forgot to mention that the feedback message was "Message has been sent." But I did not receive any emails on my dp_pie@gmail.com (not even spam folders). – ysPhongE Jul 15 '14 at 07:38
  • You should set your address / password from your Gmail. You can read [Having trouble with PHPmailer](http://stackoverflow.com/questions/13344239/having-trouble-with-phpmailer) – Debflav Jul 15 '14 at 07:54
  • If you are sending the messages out through the MTA running on the localhost, then I'm surprised you would need to use SMTP Authentication. Most MTA's only require authentication for SMTP relaying of messages originating from a remote host. Are you sure that your MTA on the local host really requires authentication? Moreover, are you sure there is really an MTA running on the localhost? If so, there should be something in the MTA's logs that should point to what is causing the problem. – mti2935 Jul 15 '14 at 22:00

0 Answers0