Monday, May 14, 2012

phpgmailer set from mail issue

I'm trying to use php mail class as shown in the example.

I'm using it my site's contact us form. Can I set the "$mail->From" address as the person who filled the form? When i reveive the mail it always shows that the "from address" as my gmail account. Any help would really helpful.

$mail = new PHPGMailer();
$mail->Username = '';
$mail->Password = 'gmailpassword';
$mail->From = ''; // Like to set this address as the address of the person who filled the form
$mail->FromName = 'User Name';
$mail->Subject = 'Subject';
$mail->AddAddress(''); // To which address the mail to be delivered
$mail->Body = 'Hey buddy, heres an email!';


No comments:

Post a Comment