Jump to content

Email from my website come from "Nobody"


jayzee

Recommended Posts

When I get the form email from my website they come from "Nobody" Can I change that to "your website" or any other?

 

i am using the following codes

 

 

FOT HTML

<form action="V019mail31.php"" method="post" id="contactform">









Full Name: <br /><input name="name" type="text" /><br />
Organization: <br /><input name="organization" type="text" /><br />
Designation: <br /><input name="designation" type="text" /><br />
Mailing Address:<br />

<textarea name="message" rows="3" cols="70">
</textarea><br />
Mobile: <br /><input name="mobile" type="text" /><br />
Telephone: <br /><input name="phone" type="text" /><br />
Fax: <br /><input name="fax" type="text" /><br />
Email: <br /><input name="email" type="text" /><br />
<input type="submit" />
</form>

 

 

 

 

For PHP

 



<?

$name = $_REQUEST['name'];
$organization = $_REQUEST['organization'];
$designation = $_REQUEST['designation'];
$message = $_REQUEST['message'];
$phone = $_REQUEST['phone'];
$mobile = $_REQUEST['mobile'];
$fax = $_REQUEST['fax'];
$email = $_REQUEST['email'];

mail($email, "The Centre For Change - Thank you for your e-mail!",
"Dear $name\n\n Thank You!\n\n We have received your request for registration.\n Please note that your confirmation is subject to receipt of payment.\n\nRegards\nThe Centre For Change");

mail( "[email protected]", "Online Registeration - $name ", 
"Online Registeration\n\nFull Name: $name,\nOrganization: $organization,\nDesignation: $designation,\nMailing Address: $message,\nMobile: $mobile,\nPhone: $phone,\nFax: $fax,\nEmail: $email,\nMailing Address: $message, " );
header( "Location: tu.html" );
?>

 

I have reviewed the old post but its still not solving my problem

 

Need help

 

You can vie the screenshot as well from here:

 

On our recieving end:

2011-01-18_050618.gif

 

On Client End: (this is the auto-responder email sent to client as the form is submitted)

2011-01-18_050630.gif

Link to comment
https://forums.phpfreaks.com/topic/224926-email-from-my-website-come-from-nobody/
Share on other sites

The mail() function has an optional 4th (and 5th) parameter which can be used to set the From field.

 

mail($to, $subject, $message, "From: [email protected]");

 

Check out the function options and examples here: http://us.php.net/manual/en/function.mail.php

The way you are doing this will confuse you if your mail scripts get complicated. Rather break it up into variables and mail from there.

 

For your problem, add a headers variable and then add your From header in there. You can also specify a reply to address in the header variable if you want users to be able to reply to that email address and have it delivered elsewhere.

 

$subject = "The Centre For Change - Thank you for your e-mail!";
$body = "Dear $name\n\n Thank You!\n\n We have received your request for registration.\n Please note that your confirmation is subject to receipt of payment.\n\nRegards\nThe Centre For Change";
$headers = "From: [email protected]";
mail($email, $subject, $body, $headers);

 

$email = "[email protected]";
$subject = "Online Registeration - " . $name;
$body = "Online Registeration\n\nFull Name: $name,\nOrganization: $organization,\nDesignation: $designation,\nMailing Address: $message,\nMobile: $mobile,\nPhone: $phone,\nFax: $fax,\nEmail: $email,\nMailing Address: $message, ";
$headers = "From: [email protected]";
mail($email,$subject,$body,$headers);

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.