Hi world.
I am creating a helpdesk system for my company.
i would like to know more about the mail() function PHP uses. I have had a brief play with the following code but all i ever get is the echo.... message delivery failed...... it is quite annoying. (i understand this is basic code but when i get this wokring ill tart it up and even make it html. wow!)
$to = $email;
$subject = "Your Helpdesk Call Has Been Logged With ID ";
$body = "Please use the above ID in all correspondance";
$headers = "From: myaddress@mycompany.org";
if (mail($to, $subject, $body, $headers)) {
echo("
Message successfully sent!
");
} else {
echo("
Message delivery failed...
");
}
this code come directly after my insert statement... which totally works.
I am using php, mysql and IIS 6. our mail server is an exchange server and i have added the address etc to the php.ini file... like so...
[mail function]
; For Win32 only.
SMTP = Exchange_Server_Name
smtp_port = 25
; For Win32 only.
;sendmail_from = myaddress@mycompany.org
is there anything more i need do?
any ideas would be great.
many thanks!