iMarkDesigns
iMarkDesigns

Reputation: 1262

Email address not displaying correct but use bluehost instead

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.

  1. Use to get the info of registrant
  2. Use registrant email address
  3. Mail Process to confirm registrant and download link

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:

  1. [email protected] (Mail From)
  2. Company Name (Mail Name)

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

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

Answers (2)

iMarkDesigns
iMarkDesigns

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:

  1. My PHP Mail script is working correctly and fine.
  2. Hosting server do not have email set and up that will reflect as dependent to the SMTP response instead they use GoDaddy email.
  3. According to Bluehost: "all we need to do is set up a bogus email account... it doesn't even have to be an account that exists at GoDaddy. As long as the contact form email and the email on the bluehost system match"
  4. We create alternative email, "[email protected]"

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

Matt The Ninja
Matt The Ninja

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

Related Questions