Okay, here's the deal. This is the seventeenth (yes the seventeenth! :mad: ) PHP mail script I've tried.
I have managed to get it to send I think, as I get a confirmation. This is the script I'm using:
<html>
<head><title>PHP Mail Sender</title></head>
<body>
<?php
/ All form fields are automatically passed to the PHP script through the array $HTTP_POST_VARS. /
$email = 'myemail@mydomain.com';
$subject = $HTTP_POST_VARS['subject'];
$message = $HTTP_POST_VARS['message'];
/ Sends the mail and outputs the "Thank you" string if the mail is successfully sent, or the error string otherwise. /
if (mail($email,$subject,$message)) {
echo "<h4>Thank you for sending email</h4>";
} else {
echo "<h4>Can't send email to $email</h4>";
}
?>
</body>
</html>
However, my webserver tells me the following:
Use the PHP mail function and set the mail from using the following line of code - replacing email@mydomain with the correct domain name.
ini_set("sendmail_from", " email@mydomain ");
It also says I need to use SMTP....
Also it says it needs a to and a from email, the to which I will have as my email and the from as the email the user inputs so I can get back to them.
I don't have input fields for email in my corresponding HTML file, I think I can manage that bit okay, but this just makes me want to break down in tears.
Can anyone help so that all of the above problems are resolved in the PHP script???
So, can you help me change the bit of code they tell me to, use SMTP and help sort the variables or whatever for the email? (see I [sarcastic] really know what I'm doing)
I would be beyond greatful and would probably write you a letter thanking you in person if you can gelp with this! I've been trying to do this for 3 months now!!!!
PLEASE.