Jump to content

phpmailer issue


Ajpalma

Recommended Posts

when I send emails form my php application they only send to internal network emails. Is this more likley an SMTP issue or in the code -

note- theres no error message, it just doesnt go through

thanks -

Alex

 

Heres the code -

 

require("phpmailer/class.phpmailer.php");

$emaila = $_POST['emaila'];

$emailb = $_POST['emailb'];

$emailc = $_POST['emailc'];

 

$yourname = $_POST['yourname'];

$femail = $_POST['fromemail'];

$mail = new PHPMailer();

$mail->IsSMTP(); // telling the class to use SMTP

$mail->Host = "smtp.fatcow.com"; // SMTP server

$mail->From = "$femail";

 

$mail->AddAddress("$emaila");

 

if ($emailb != ''){

$mail->AddAddress("$emailb");

}

 

if ($emailc != ''){

$mail->AddAddress("$emailc");

}

 

 

$mail->Subject = "Requested Document";

$mail->Body = "Requested Document";

$mail->WordWrap = 50;

$path = '/PDF_STORAGE/' . $_POST['id'] . '.pdf';

$mail->FromName = "$yourname";

 

$mail->AddAttachment($path);

if(!$mail->Send())

{

  echo "EMAIL HAS NOT BEEN SENT!<br>";

  echo "Mailer Error: " . $mail->ErrorInfo;

  echo "<br>Please enter in both email address correctly.  If this problem persists, then the smtp server is down.";

}

else

{

  echo "Your email has been sent";?>

  <META HTTP-EQUIV="Refresh"

      CONTENT="2; URL=index.php">

 

  <?php

}

?>

Link to comment
https://forums.phpfreaks.com/topic/58876-phpmailer-issue/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.