473,385 Members | 2,005 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Proper way to send mail

I need a good example of how to send mail using PHP. I've used the
mail() function, but I can't set the Reply-To address using it. Or can
I? So I've been using sendmail instead, but I can't seem to figure out
how to get the username in the header. Something like this:
<first last> fi********@somewhere.com

Escaping the '<>' is the problem. Also, I'd like to know how to validate
the input as this info will come from a web based form on my site and I
want to avoid the spammers.
TIA
Aug 25 '05 #1
3 1229
In article <lo***************************@sage.thethurmans.co m>,
Lorenzo Thurman <lo*****@nospamthethurmans.com> wrote:
I need a good example of how to send mail using PHP. I've used the
mail() function, but I can't set the Reply-To address using it. Or can
I? So I've been using sendmail instead, but I can't seem to figure out
how to get the username in the header. Something like this:
<first last> fi********@somewhere.com

Escaping the '<>' is the problem. Also, I'd like to know how to validate
the input as this info will come from a web based form on my site and I
want to avoid the spammers.
TIA


It must be your configuration as I have no problems specifying a "Cc:"
header in my emails.

--
DeeDee, don't press that button! DeeDee! NO! Dee...

Aug 25 '05 #2
Lorenzo Thurman wrote:
I've used the mail() function, but I can't set the Reply-To address
using it. Or can I?
Yes, you can. The mail() docs give examples.
So I've been using sendmail instead, but I can't seem to figure out
how to get the username in the header. Something like this:
<first last> fi********@somewhere.com


Almost. The greater-/less-than signs bracket the address and
not the name. So, for example, to set a single name-addr in
the Reply-To header:

Reply-To: Lorenzo Thurman <lt******@host.invalid>

It's covered in RFC2822 sec. 3.6.2:

http://www.ietf.org/rfc/rfc2822

--
Jock
Aug 25 '05 #3
In article <lo***************************@sage.thethurmans.co m>,
lo*****@nospamthethurmans.com says...
I need a good example of how to send mail using PHP. I've used the
mail() function, but I can't set the Reply-To address using it. Or can
I?


http://php.planetmirror.com/manual/e...mail.php#51406

Geoff M
Aug 28 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Steve Horrillo | last post by:
I can't figure out why this script won't insert the subject in the email and why can't I control the font and size being used? I'm not sure where to post this. Let me know where if this is OT. ...
6
by: DigitalRick | last post by:
I have been running CDONTS in my ASPpages to send emails to me sent from my guestbook. It had been working fine untill I upgraded to Server 2003 (I am also running Exchange 2003) all locally. I...
6
by: John J. Hughes II | last post by:
I have a service that needs to send e-mail alerts. I have been attempting to use the System.Net.Mail function from .NET but this seems to require the IIS be installed and running. Since some of...
3
by: Jens | last post by:
Hi I am writing a ASP.NET web application that must sent some e-mails. I get the exception “Could not access 'CDO.Message' object” when I call SmtpMail.Send. This only happens when I send...
3
by: RN | last post by:
I am tired of sending mail from the built-in SMTP service for so many reasons (errors are nondescriptive in the event log, it doesn't let me control which IP address it sends from, and it...
3
by: Gerard | last post by:
Hello I have created a windows service to monitor a database, it starts some checks when a timer elapses. The checks send emails depending on their findings. My issue is that when I created a...
14
by: supz | last post by:
Hi, I use the standard code given below to send an email from an ASP.NET web form. The code executes fine but no Email is sent. All emails get queued in the Inetpub mail queue. I'm using my...
15
by: cj | last post by:
How can I get a button in VB to send the contents of a text box via email in a manner similar to the "Send To\Mail Recipient" functionality that you can select via right clicking a file in Windows...
4
by: =?Utf-8?B?dHBhcmtzNjk=?= | last post by:
I have a web page that at the click of a button must send a bunch (1000+) emails. Each email is sent individually. I have the code working fine, using Mail Message classes and smtp and all that. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.