Link to home
Start Free TrialLog in
Avatar of Mohammed Nasman
Mohammed NasmanFlag for Palestine, State of

asked on

PHPMailer, return to sender functionality

Hello,

  I would like to have email return to sender functionality if the email is not valid, I have tried this code, but it didn't work, any clue about this?

...
                  include("class.phpmailer.php");                  
                  $mail = new PHPMailer();                   
                  $mail->IsMail();
                  
                  $mail->From = $from;
                  $mail->ConfirmReadingTo = $from;
                  $mail->FromName = "";
                  $mail->AddAddress($to);
                  $mail->AddCC($cc);
                  $mail->AddBCC($bcc);
                  $mail->AddReplyTo($from, "");
                  if ($mail->Send())
.....


Regards,
Mohammed
ASKER CERTIFIED SOLUTION
Avatar of hernst42
hernst42
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mohammed Nasman

ASKER

I tried it, but I didn't got any return email if I sent to unvalid address
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
$mail->Sender = "email@address.exp";
hi nplib, i tried that too after read it in phpmailer doc, but didn't work
i think the problem as hernst42 said, I need to change it to use SMTP, I tried it but got errors, even i put server and username/password

could any one give me a complete sample for sending email with smtp and have the return path?, sorry I'm not good in php, this is just a fix i have to do for part from a big application i have
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial