Thank you it worked!!
I did get the confirmation email in my inbox, however is there a way I can get it to say it's coming from a specific email address? The one it's coming from seems like some default email address of the server or something.
Thank you it worked!!
I did get the confirmation email in my inbox, however is there a way I can get it to say it's coming from a specific email address? The one it's coming from seems like some default email address of the server or something.
The email that it's going to be sent from is here:
You can try hard-coding an email address and see if that changes anything. There might be some settings with your mail server that are preventing that though.Code:mail($emailaddress, $auto_subject, $auto_body,$to);
You would hard-code it like so:
Code:mail($emailaddress, $auto_subject, $auto_body, "me@myemail.com");
Hi there,
I tried both and neither work, they only affect the email address that shows up in the body of the email, not the email address it's actually coming from..
It must be your PHP settings then. You'll have to go into your php.ini file (your server admin would have access to this) and change it there.
I asked and unfortunately it was mentioned I'd probably have to change my coding![]()
I'm sorry...
I just realized I was making a small mistake.
That should work.PHP Code:$headers = 'From: webmaster@example.com';
mail($emailaddress, $auto_subject, $auto_body, $headers);
I've been using some PHP frameworks lately where the syntax is different.
It worked!! Thank you so much
Glad it worked![]()
Ok this is my final question (seriously)...on the page where you can sign up and refer a friend, I have it so that when you click submit you get an automated email in your mailbox, can I have the same script in the same coding to send an automated email to the person that you referred it to as well?
Apart from what I already have above, I want another email to go the the person that was referred to say "So and so thought you might be interested in The Club and has referred you, etc. etc."PHP Code:<?php
$yourname = $_POST['yourname'];
$youremail = $_POST['youremail'];
$friendsname = $_POST['friendsname'];
$friendsemail = $_POST['friendsemail'];
$to = "company@rogers.com";
$subject = "Club Form-Refer A Friend";
$body = "Your Name: ".$yourname."\r\n\r\n";
$body .= "Your Email: ".$youremail."\r\n\r\n";
$body .= "Friend's Name: ".$friendsname."\r\n\r\n";
$body .= "Friend's Email: ".$friendsemail."\r\n\r\n";
$from = $youremail;
mail($to, $subject, $body, $from);
$auto_subject = "Thanks for Referring A Friend!";
$auto_body = "Thank you for referring a friend to The Club. They will receive monthly emails about our upcoming features!";
$headers = 'From: boss@company.ca';
mail($youremail, $auto_subject, $auto_body, $headers);
header("Location: http://www.mysiteca/thankyourefer.htm");
exit;
?>
Do you think I can just add another mail function right underneath the previous one?
Bookmarks