Current location: Hot Scripts Forums » Programming Languages » PHP » mail() sender address


mail() sender address

Reply
  #1 (permalink)  
Old 10-25-04, 02:19 AM
gorrilla gorrilla is offline
Newbie Coder
 
Join Date: Jan 2004
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation mail() sender address

if i'm using the mail() function to send an email (for example, for a lost password form), how do i control what shows up in the "From" field when it arrives in the person's inbox? I want it to say that it's from either the site's name or some other email address.

Anybody with suggestions?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 10-25-04, 03:18 AM
<?Wille?> <?Wille?> is offline
Junior Code Guru
 
Join Date: Jan 2004
Location: Helsinki, Finland
Posts: 666
Thanks: 0
Thanked 0 Times in 0 Posts
maby something like this
PHP Code:

$from 'passwordrecovery@example.com';

mail($to$subject$message$from); 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 10-25-04, 03:52 AM
Sabu Sabu is offline
Junior Code Guru
 
Join Date: Sep 2004
Posts: 458
Thanks: 0
Thanked 0 Times in 0 Posts
PHP Code:

$contactemail "Email_address_to_send_to";

$subject "Welcome to $title"
$headers "From: MY_EMAIL_ADDRESS"
$message "hey hey";

mail($contactemail$subject$message$headers); 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 10-25-04, 08:20 AM
<?Wille?> <?Wille?> is offline
Junior Code Guru
 
Join Date: Jan 2004
Location: Helsinki, Finland
Posts: 666
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by Sabu
PHP Code:

$contactemail "Email_address_to_send_to";

$subject "Welcome to $title"
$headers "From: MY_EMAIL_ADDRESS"
$message "hey hey";

mail($contactemail$subject$message$headers); 
yes.. exactly.. forgot the 'from:' part.. sorry for that..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 10-25-04, 08:26 AM
gorrilla gorrilla is offline
Newbie Coder
 
Join Date: Jan 2004
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
ok great sounds good, i'll give it a try when i get home.

thx for the help!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
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
Confused about the from address with php form processor AshleyQuick PHP 0 06-01-04 12:52 PM
Need to hide web address in Java PopUp JAllard15 JavaScript 4 12-24-03 06:05 PM
Announcement: Mojo Mail is now Dada Mail skazat General HotScripts Site Discussion 0 12-07-03 11:10 PM
Send email by ASP mail nghiapk ASP 1 07-09-03 01:47 AM


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