Jump to content

New server causing phpmailer to not work ?


swatisonee

Recommended Posts

Have a strange problem on a new server that we've migrated to. I use class.phpmailer extensively with no problems but since moving to the new one, i notice that emails sent to ids on the same domain as the sender just dont go thru . i cannot figure out why this could be happening. What could i do to resolve this problem please?

Thanks: Swati.

 

OLD SERVER : PHP 2.6.4 , MYSQL - 4.1.12

NEW SERVER PHP 3.2.4 , MYSQL 5.1.50

 

My code snippet


<?
if($_POST['submit']){
$dec = $_POST["dec"];
require("class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsMail();     

$mail->From = "[email protected]";
$mail->FromName = "exam";


if ($dec == "on"){
  $mail->AddAddress("[email protected]");   //  doesnt go thru
  $mail->AddAddress("[email protected]"); // goes thru
   // add it
}
}
?>

Ohay,

 

When u use a $mail->IsMail(); u have to be a caution, maybe your server don`t have a good configuration from mail server, try to use a SMTP account (Gmail works fine) to send your e-mails by PHP. A good link with examples its here:

http://www.ogenial.com.br/blog/phpmailer-como-enviar-e-mails-atraves-do-php/

 

Don`t take focus on the text, only on code samples, ok?

 

 

 

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.