PhpMailer Can't set sender email -


i'm trying set sender email in phpmailer, getting form, receive email wrong email address.

this code:

$mail = new phpmailer (); $mail->from=$user_mail;  $mail->fromname=$nome; $mail->addaddress($recipient); 

$recipient email address, while $user_mail email address of user.

i tried doing echo of $user_mail, , print right user email address, receive wrong address via email.

thanks help!

try using following set both address , name @ same time:

$mail->setfrom($user_mail, $nome); 

the phpmailer github project has examples, instance: https://github.com/synchro/phpmailer/blob/master/examples/test_mail_basic.php


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -