473,230 Members | 1,482 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,230 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 1224
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: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, youll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...

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.