Jump to content

why does PHPmailer uses my username as from who I got the mail.


shedokan

Recommended Posts

When I send the mail it uses my gmail username as "From:".

 

phpmailer.jpg

 

here's my script:

<?php 
require("class.phpmailer.php"); 
$mailer = new PHPMailer(); 
$mailer->IsSMTP(); 
$mailer->Host = 'ssl://smtp.gmail.com:465'; 
$mailer->SMTPAuth = TRUE; 
$mailer->Username = '[email protected]';  // Change this to your gmail adress 
$mailer->Password = 'pass';  // Change this to your gmail password 
$mailer->From = "[email protected]"; 
$mailer->FromName = "Test"; // This is the from name in the email, you can put anything you like here 
$mailer->Subject = "Test"; 
$mailer->Body = "
name: Test <br>
E-Mail: [email protected] <br>
<div style='width:75%;'>
<center>-----------------------------------------------------------------------------<br>
Test
<br>-------------------------------------------------------------------------------------------------</center><br>
It's just a test.
<br><center>-------------------------------------------------------------------------------------------------<br></center>
</div>
"; 
$mailer->CharSet = 'utf-8'; 
$mailer->AddAddress("[email protected]"); 
  if(!$mailer->Send()) 
   { 
      echo "Message Sent<br/ >"; 
      echo "Error: " . $mailer->ErrorInfo; 
   } 
?> 

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.