[thelist] A New Query regarding PHP mail with multiple recipients and form data notworking
Tony Crockford
tonyc at boldfish.co.uk
Fri Sep 19 10:14:17 CDT 2003
On Fri, 19 Sep 2003 07:08:16 -0700, Joel D Canfield <joel at spinhead.com>
wrote:
> Should this be working? It's on a Windows box with
> register_globals off, which is why I'm including
> ini_set('SMTP', "mail.24caratdesign.com");
I had a fun time getting php mail working from my windows box too!
I have postcast server set up on it which makes things a little easier,
but there are fairly big differences in the way PHP mail needs to be coded
for Windows.
here's some links I found useful:
http://www.zend.com/manual/function.mail.php
http://www.potentialcreations.com/articles/win_mail.php
http://bugs.php.net/bug.php?id=15841
I recall the problems I had being associated with the newline characters
in the headers, but I can't find the link.
This is what I ended up with:
#send mail
$esender = $_POST['whofrom']; #who the message is from
$eto = $_POST['emailaddress']; #who the email is getting sent to
$message = encodeMessage(); #generate the encoded string
$subject = "$esender has sent you a semaphore message!"; #subject of
the message with sender embeded
#setup the mail headers
$headers = "";
$headers .= "From: Caught in The Web Semaphore
Game<semaphore at torbytes.com>\r\n";
$headers .= "X-Sender: <semaphore at torbytes.com>\r\n";
$headers .= "X-Mailer: PHP\r\n"; //mailer
$headers .= "X-Priority: 3\r\n"; //1 UrgentMessage, 3 Normal
$headers .= "Return-Path: <semaphore at torbytes.com>\r\n";
#format the url to be embeded in the message content
$message = $GLOBALS["flashURL"]."?enc="."$message";
#the message
$poststring = "Hello! \r\n\r\n$esender has visited the Caught in the
Web website <http://www.torbytes.co.uk> and sent you a semaphore message!
\r\n\r\nTo view their message either double click the link below that will
take you to your semaphore message, or copy and paste the link into your
web browser address bar (remembering not to include the '<' and '>'
characters) and press return.\r\n\r\n < $message >\r\n\r\nThank you and
good luck!\r\n\r\n";
#send the mail
$mailresult = mail($eto,$subject,$poststring,$headers);
I'm sure you could pick that to bits and make sense of it in your context?
HTH
Tony
--
http://www.xebit.net/
Sent with M2, Opera's revolutionary e-mail client:
https://secure.bmtmicro.com/opera/buy-opera.html?AID=627923
More information about the thelist
mailing list