PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 31st, 2000, 10:37 PM
Porcupine Porcupine is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2000
Posts: 6 Porcupine User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi all,

Does anyone know how to use the Mail function in PHP3 and set the from / reply to field to something other than nothing like I keep getting?

Here's my line of code:
mail($recipient, $subject, $body, "From: me@emailnReply-To: me@emailnX-Mailer: PHP/" . phpversion());

But what happens is a get a reply to 'Noboby' and the email I want in the reply field appears in the body.

Reply With Quote
  #2  
Old June 1st, 2000, 12:28 AM
mavenman mavenman is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2000
Posts: 4 mavenman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to mavenman
The following works for me:

$mailto = "Username1<useremail1@domain.com>";
$subject = "Subject Line for Mail Message";
$body = "Body Line 1n";
$body .= "Body Line 2n";
$body .= "Body Line 3n";
$body .= "Body Line 4n";
$header = "From: Username2<useremail2@domain.com>n";

mail($mailto, $subject, $body, $header);

I would assume you can add the following for the reply-to portion:

$header. = "Reply-To: Username3<useremail3@domain.com>n";

Hope this helps,

Maven

Reply With Quote
  #3  
Old June 1st, 2000, 12:33 AM
Porcupine Porcupine is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2000
Posts: 6 Porcupine User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Cheers for the help.
It didn't work though - I think it's just because computers hate me. Oh well.

Reply With Quote
  #4  
Old June 1st, 2000, 01:03 AM
mavenman mavenman is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2000
Posts: 4 mavenman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to mavenman
From your original post you will need to add <> around the actual e-mail address you want to use. I would assume the msg you are receiving with the nobody@domain address looks similar to:

me@email<nobody@domain.com>

try:

"From: me@email<me@email>n"
"Reply-To: me@email<me@email>n"

Reply With Quote
  #5  
Old June 1st, 2000, 07:14 AM
ayadava ayadava is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Posts: 14 ayadava User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to ayadava
Hi there,

i've encountered that generally the from-mail option doesnt work, when you dont include an extension.
so instead of "me@email" try "me@email.com" and see if that works.
good luck!

Reply With Quote
  #6  
Old June 1st, 2000, 09:39 AM
JaMmed JaMmed is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 1999
Posts: 4 JaMmed User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
forgot to type in the message,
well i agree with porcupine

[This message has been edited by JaMmed (edited June 01, 2000).]

Reply With Quote
  #7  
Old June 1st, 2000, 10:53 AM
jochum jochum is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2000
Location: In nederland
Posts: 41 jochum User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 40 m 2 sec
Reputation Power: 14

mail("someone@somehost.com", "the subject", "nnntest","From:webmaster <webmaster@$SERVER_NAME>nReply-To:webmaster <webmaster@$SERVER_NAME>nX-Mailer: PHP/" . phpversion());

For some reason this mail works fine, but doesn't arrive?

server error:
Email adres sender doesn't exists?
... while talking to mail.somehost.com.:
>>> MAIL From:<nobody@localhost.localdomain> SIZE=46
<<< 501 <nobody@localhost>... Sender domain must exist
501 someone@somehost.com... Data format error


Does somebody has a clue?

Reply With Quote
  #8  
Old June 1st, 2000, 03:57 PM
Porcupine Porcupine is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2000
Posts: 6 Porcupine User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks for all the help. I think it was just a bug in my version of PHP! I ended up bouncing it out to an NT box and using ASP-Mail to send it. Not the nicest way to do it but it works now.

[This message has been edited by Porcupine (edited June 01, 2000).]

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > Mail from 'Nobody' in PHP3

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap