Reputation: 1262
I would like to know why does the email as recipient display Bluehost email address instead of my given email inside my PHPMailer.
Scenario
I have 3 PHP files.
What Now
(1)Once a user registered, (2)a simple modal will popup to notify them that he/she will need to confirm the form action. Once done that. (3) An email from our server will process and use his/her email as Mail TO
while my Mail From
and Mail Name
is using my domain info:
Case Issue
After several mail test, I am wondering why does the email display as [email protected]
instead of my given Mail From
.
Is there any problem with my script or this can be configure via Bluehost? I wanted to know before I proceed and call Bluehost about this.
Code from PHP
include('class.phpmailer.php');
$post = $_POST;
$recepient = $post['confirmed_mail'];
$carbon = '';
$bcarbon = '[email protected]';
$EmailName = 'Company Name';
$EmailAddress = '[email protected]';
$message = 'Message will display here';
$mail = new PHPMailer();
$mail->IsMail();
$mail->FromName = $EmailName; // Sender Name
$mail->From = $EmailAddress; // Sender Email
$mail->AddAddress($recepient);
$mail->AddCC($carbon);
$mail->AddBCC($bcarbon);
$mail->IsHTML(true); // Send as HTML
$mail->Subject = "Mail Subject";
$mail->Body = $message;
$mail->AltBody = $message;
if (!$mail->Send()) :
echo "Message was not send, Please check the error <p>";
echo "Mailer Error: ".$mail->ErrorInfo;
endif;
Note: I rename the old code here. $EmailFrom
to $EmailName
and $EmailName
to $EmailAddress
to avoid confusion.
Mail Output Screenshot
PHP Code from Registration
This is what my pattern where it works fine and receive all information correctly at my Email App.
$mail->FromName = ''.$post['rf_fname'].' '.$post['rf_lname'].''; // Sender Name
$mail->From = $post['rf_email']; // Sender Email
Upvotes: 0
Views: 143
Reputation: 1262
Ok, this case is fixed and accomplished with the help of Bluehost support.
Note
Solutions to this question might be different from the other, though it relates to the other/past questions or problems (which i tried the solution but no luck). Here's why:
So after I managed these list, the Header From: [email protected]
went to Header From: MJ Real Estate Investors, Inc. <[email protected]>
and it display correctly now.
Upvotes: 0
Reputation: 2731
Look at this
$EmailFrom = 'Company Name';
$EmailName = '[email protected]';
$mail->FromName = $EmailFrom; // Sender Name
$mail->From = $EmailName; // Sender Email
From & Name are the wrong way around, my guess...
Upvotes: 1