Jump to content

Archived

This topic is now archived and is closed to further replies.

cattledogz

mail functions

Recommended Posts

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:

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

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

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...

jen

Share this post


Link to post
Share on other sites
Insert the from address directly into the headers

[code]$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);
[/code]

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.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.