The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages
> PHP Development
|
Mail from 'Nobody' in PHP3
Discuss Mail from 'Nobody' in PHP3 in the PHP Development forum on Dev Shed. Mail from 'Nobody' in PHP3 PHP Development forum discussing coding practices, tips on PHP, and other PHP-related topics. PHP is an open source scripting language that has taken the web development industry by storm.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

May 31st, 2000, 10:37 PM
|
|
Junior Member
|
|
Join Date: May 2000
Posts: 6
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.
|

June 1st, 2000, 12:28 AM
|
|
Junior Member
|
|
Join Date: May 2000
Posts: 4
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
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
|

June 1st, 2000, 12:33 AM
|
|
Junior Member
|
|
Join Date: May 2000
Posts: 6
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.
|

June 1st, 2000, 01:03 AM
|
|
Junior Member
|
|
Join Date: May 2000
Posts: 4
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
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"
|

June 1st, 2000, 07:14 AM
|
|
Junior Member
|
|
Join Date: Jun 2000
Posts: 14
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
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!
|

June 1st, 2000, 09:39 AM
|
|
Registered User
|
|
Join Date: Oct 1999
Posts: 4
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).]
|

June 1st, 2000, 10:53 AM
|
|
Contributing User
|
|
Join Date: Apr 2000
Location: In nederland
Posts: 41
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?
|

June 1st, 2000, 03:57 PM
|
|
Junior Member
|
|
Join Date: May 2000
Posts: 6
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).]
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|