Current location: Hot Scripts Forums » Programming Languages » PHP » Mail fields


Mail fields

Reply
  #1 (permalink)  
Old 02-28-05, 03:34 AM
mdhall's Avatar
mdhall mdhall is offline
Aspiring Coder
 
Join Date: Oct 2003
Posts: 510
Thanks: 1
Thanked 1 Time in 1 Post
Mail fields

My site allows a user to send email to another user thru the mail() function, however, the "From" field shows up as....

MySiteName.com@servernumberxxx.thewebhostname.com

The webhost support person says this can't be changed. Is there anything in the mail function I can use to eliminate or hide the...

@servernumberxxx.thewebhostname.com

....section?

What I'm using ( very basic, and please point out anything I should change )...

$sendto = "$lister_email";
$subject = "Your Vehicle";
$body = "The following message is from $sender_fname $sender_lname about your listing at MySiteName.com.\n\n
$sender_fname's message...\n
\"$message\"\n\n
You can respond to this email directly to the interested person at $sender_email";
$from = "From: MySiteName.com\n";

mail($sendto, $subject, $body, $from);
Reply With Quote
  #2 (permalink)  
Old 02-28-05, 04:02 AM
netbakers's Avatar
netbakers netbakers is offline
Newbie Coder
 
Join Date: Dec 2004
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
try this

PHP Code:

<?


$fname 
"Asim";

$from "ch.asim@netbakers.com";

$recipient "info@netbakers.com";

$subject "Your code";

$message " Name : $fname \n\n Email : $from \n\n message text here";
        
/* To send HTML mail, you can set the Content-type header. */
$headers  "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/plain; charset=iso-8859-1\r\n";

/* additional headers */

$headers .= "From: $fname <$from>\r\nReply-To: $from \r\n";

mail ($recipient$subject$message$headers);

echo 
"<script>alert('mail has been sent successfully!')</script>";

echo 
"<script language=javascript>location.href='index.html';</script>";

exit();

?>
__________________
---------------------------------------------------------

info@netbakers.com

http://www.netbakers.com/
Reply With Quote
  #3 (permalink)  
Old 02-28-05, 04:15 AM
mdhall's Avatar
mdhall mdhall is offline
Aspiring Coder
 
Join Date: Oct 2003
Posts: 510
Thanks: 1
Thanked 1 Time in 1 Post
That seems to have done the trick...thanx so much.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to add new fields to front page of CNCat? skimpydj PHP 0 01-21-05 12:07 PM
formmail problem gscraper Perl 12 08-27-04 03:06 AM
LWP posting variable numbers of fields? afenn Perl 1 05-14-04 11:02 PM
displaying fields on the same form aliasgar ASP 1 01-22-04 12:50 PM


All times are GMT -5. The time now is 05:34 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.