Jump to content


Photo

Quick Email Script Question!


  • Please log in to reply
3 replies to this topic

#1 gl_itch

gl_itch
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 12 April 2006 - 12:16 AM

Hi, Im a bit of a newb with PHP so Im hoping you guys can help....

This script sends an email to my address with the users already entered variables. I use this to basically keep record.

My script is as follows:
$msg="\n".date("m/d/Y")."\n".date("h/i/A")."\n".$_POST['first_name']." ".$_POST['last_name']."\n".$_POST['payer_email']."\n".$_POST['custom'];
        mail("email@gmail.com",date("m/d/Y")",$msg,"from: email@gmail.com");

Now as you can see in the last line, the subject right now just posts the date, so the message's subject would read "04/11/06", I want the subject to be "Purchase 04/11/06"

How can I do this? No matter how I enter it, I get an error.

Thanks in advanced.





#2 kc5tvd

kc5tvd
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 12 April 2006 - 12:40 AM

[!--quoteo(post=363856:date=Apr 11 2006, 07:16 PM:name=gl_itch)--][div class=\'quotetop\']QUOTE(gl_itch @ Apr 11 2006, 07:16 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Hi, Im a bit of a newb with PHP so Im hoping you guys can help....

This script sends an email to my address with the users already entered variables. I use this to basically keep record.

My script is as follows:
$msg="\n".date("m/d/Y")."\n".date("h/i/A")."\n".$_POST['first_name']." ".$_POST['last_name']."\n".$_POST['payer_email']."\n".$_POST['custom'];
        mail("email@gmail.com",date("m/d/Y")",$msg,"from: email@gmail.com");

Now as you can see in the last line, the subject right now just posts the date, so the message's subject would read "04/11/06", I want the subject to be "Purchase 04/11/06"

How can I do this? No matter how I enter it, I get an error.

Thanks in advanced.
[/quote]

I am not in a place where i can test it but try this.

$msg="\n".date("m/d/Y")."\n".date("h/i/A")."\n".$_POST['first_name']." ".$_POST['last_name']."\n".$_POST['payer_email']."\n".$_POST['custom'];
$date = date('m/d/Y');
        mail("email@gmail.com","Purchased $date","$msg","from: email@gmail.com");



#3 gl_itch

gl_itch
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 12 April 2006 - 12:44 AM

[!--quoteo(post=363857:date=Apr 11 2006, 07:40 PM:name=kc5tvd)--][div class=\'quotetop\']QUOTE(kc5tvd @ Apr 11 2006, 07:40 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
I am not in a place where i can test it but try this.

$msg="\n".date("m/d/Y")."\n".date("h/i/A")."\n".$_POST['first_name']." ".$_POST['last_name']."\n".$_POST['payer_email']."\n".$_POST['custom'];
$date = date('m/d/Y');
        mail("email@gmail.com","Purchased $date","$msg","from: email@gmail.com");
[/quote]

Ive tried that, I get a parse error. Even Purchase $date("m/d/Y") does the same.

Any other ideas? Anyone? Thanks in advanced.

#4 gl_itch

gl_itch
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 12 April 2006 - 01:29 AM

[!--quoteo(post=363859:date=Apr 11 2006, 07:44 PM:name=gl_itch)--][div class=\'quotetop\']QUOTE(gl_itch @ Apr 11 2006, 07:44 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Ive tried that, I get a parse error. Even Purchase $date("m/d/Y") does the same.

Any other ideas? Anyone? Thanks in advanced.
[/quote]


Got it, it should have been: "Purchase " . date("m/d/Y")

Thanks.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users