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 {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
Link to comment
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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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