View Full Version : Changing email name from server
Dirt_Diver
02-02-2009, 03:11 AM
How can I remove this from the email server?
When a user registers on mysite they get an email from:
treasureshack@linhost275.prod.mesa1.secureserver.net
How can I change it so it only shows up as:
TreasureShackOnline
Schmoopy
02-02-2009, 10:27 AM
Add this somewhere in your mail() function:
$to = $_POST['email'];
$subject = "Registration";
$message = "Thanks for registering..."; // Bla bla bla
$header = "From: TreasureSchackOnline <no-reply@treasureshack.com>";
mail ($to, $subject, $message, $header);
Hope that helps.
Dirt_Diver
02-02-2009, 12:22 PM
I can't use that, here is my code, this is a register page and it creates the email to the user and makes them click on the page to verify they are who they say they are...
$verifyurl = "http://www.treasureshackonline.com/forums/verify.php";
$verifystring = urlencode($randomstring);
$verifyemail = urlencode($_POST['email']);
$validusername = $_POST['username'];
$mail_body=<<<_MAIL_
Hi $validusername,
Please click on the following link to verify your new account:
$verifyurl?email=$verifyemail&verify=$verifystring
_MAIL_;
mail($_POST['email'], $config_forumsname . " User verification", $mail_body);
Schmoopy
02-02-2009, 01:29 PM
You can still add the header like so:
$verifyurl = "http://www.treasureshackonline.com/forums/verify.php";
$verifystring = urlencode($randomstring);
$verifyemail = urlencode($_POST['email']);
$validusername = $_POST['username'];
$header = "From: TreasureShackOnline <no-reply@treasureshackonline.com>";
$mail_body=<<<_MAIL_
Hi $validusername,
Please click on the following link to verify your new account:
$verifyurl?email=$verifyemail&verify=$verifystring
_MAIL_;
mail($_POST['email'], $config_forumsname . " User verification", $mail_body, $header);
Dirt_Diver
02-02-2009, 01:53 PM
Yep that did it, I wasn't sure if I could do it like that or not..
Thanks
Schmoopy
02-02-2009, 02:05 PM
No problem, glad to be of service :)
Oh - and just in case you didn't know, your forum isn't working. I'm sure you're aware of this but I assume it's because your doing some testing or what not.
Anyway, good luck with it.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.