Jump to content


mail functions

  • Please log in to reply
1 reply to this topic

#1 cattledogz

  • Members
  • Pip
  • Newbie
  • 8 posts

Posted 24 March 2006 - 09:34 PM

Ok.. I have my html form and it does email everything.. my new problem is that I also have the form set up to email the person submitting it.. When it emails the person, despite me having my code like this:

$EmailFrom = 'RFID Solutions {jennie@xxx.ca}';

mail("$EMailAddress","RFID - Thank you for taking our Survey", $info, $surinfo,$EmailFrom);

the {} around the email addy are really <> only because it dissappeared in my code here.

It emails the "thanks for taking our survey" to the submitter, but it comes from the server (apache@myhost.com)...rather than the email address I defined in my code....

What on earth am I not doing??? I've tried several different things to no avail...


#2 mlin

  • Members
  • PipPipPip
  • Advanced Member
  • 91 posts

Posted 24 March 2006 - 11:01 PM

Insert the from address directly into the headers

$headers = "From: You <you@yourdomain.com>\r\n";
$headers .= //any additional headers

$subject = 'email subject';
$message = 'email message';

mail($to_email_address, $subject, $message, $headers);

I don't like mailing items right away when the user submits data, but rather insert it into a temp db table, and use cron to call a separate script every min checking for new messages.

Takes the performance issues of mail() away from the user at least.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users