inherit
8696
0
Jan 3, 2024 23:35:38 GMT -8
The Dark Knight
Hope is a dangerous thing.
38,980
April 2003
avtar
|
Post by The Dark Knight on May 3, 2009 14:59:11 GMT -8
<?php
$subject ="$subject";
$message="$detail";
$mail_from="$customer_mail";
$header="from: $name <$mail_from>";
$to ='someone@somewhere.com';
$send_contact=mail($to,$subject,$message,$header);
if($send_contact){ echo "We've recived your contact information"; } else { echo "ERROR"; } ?>
Right. Nothing could be simpler.
I've even set up an SMTP server on my system, but on execution of the above it gives me the error : Warning: mail() [function.mail]: SMTP server response: 501 Syntax Error: Unbalanced angle brackets
>.<
|
|
inherit
130228
GamingMedley charles.stover
0
Nov 18, 2012 0:12:30 GMT -8
Charles Stover
PM me for Arcade or ShoutBox support
1,731
August 2008
gamechief
|
Post by Charles Stover on May 3, 2009 17:13:54 GMT -8
$subject ="$subject"; $message="$detail"; $mail_from="$customer_mail"; Why?
$subject = $subject; $message = $detail; $mail_from = $customer_mail;
I imagine the error lies in the $header. Most likely the $mail_from, since < and > are the only "angle brackets" I can see.
|
|
inherit
8696
0
Jan 3, 2024 23:35:38 GMT -8
The Dark Knight
Hope is a dangerous thing.
38,980
April 2003
avtar
|
Post by The Dark Knight on May 3, 2009 22:40:05 GMT -8
Edited:
$header="from: $name <$mail_from>";
To:
$header="from: $mail_from;
And it worked, although I'm not happy about ditching the name of the user. Makes one entry invalid.
|
|
inherit
39608
0
Nov 26, 2011 18:53:00 GMT -8
iDunk
Previously Computerpros
2,533
April 2005
computerpros
|
Post by iDunk on May 4, 2009 15:13:18 GMT -8
It sounds to me like it could be a server configuration issue.... :-\ I've always been able to do the NAME <EMAIL@EMAIL.com> format and have it work.... :-\
-iDunk
|
|
inherit
130228
GamingMedley charles.stover
0
Nov 18, 2012 0:12:30 GMT -8
Charles Stover
PM me for Arcade or ShoutBox support
1,731
August 2008
gamechief
|
Post by Charles Stover on May 4, 2009 19:43:50 GMT -8
name <email> is valid. But whatever works.
|
|
inherit
100824
0
May 13, 2012 5:37:49 GMT -8
Michael
14,585
March 2007
wrighty
|
Post by Michael on May 6, 2009 1:47:37 GMT -8
$header = "From: " . $name . " <" . $email . ">";That's what I use! Works!
|
|