Jump to content

mail functions


cattledogz

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 {[email protected]}';

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 ([email protected])...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
Link to comment
https://forums.phpfreaks.com/topic/5719-mail-functions/
Share on other sites

Insert the from address directly into the headers

[code]$headers = "From: You <[email protected]>\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.
Link to comment
https://forums.phpfreaks.com/topic/5719-mail-functions/#findComment-20419
Share on other sites

Archived

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

×
×
  • Create New...

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.