Good! Now, we know the code is solid and it is not your website code. ( Well, maybe…)
Since you can not send an email, it must be your outlook or your server. If you want to send me a copy of your form and PHP code, you can zip it up and attach it in a private message and I will test it on my server.
Just take out any passwords in the code. I will change the addresses to my email accounts and test it for
you. (I am gone the rest of day and night, so it would be tomorrow morning.)
If you want to add some error tracking in your mailing code, you can do so this way:
if (mail(…)) {
die(" Your email was sent!");
} else {
die(" Your email failed! ");
}
This type of code basically just lets you know if it is the mail function that failed or not. If you add the code
to the first email, it will tell you if it actually mailed the email or not. If it was sent, then it is your server or
your mail client. I did some further research for you and found this quote:
sending mail in php is not a one-step process. mail() returns true/false, but even if it returns true, it doesn't mean the message is going to be sent. all mail() does is add the message to the queue(using sendmail or whatever you set in php.ini)there is no reliable way to check if the message has been sent in php. you will have to look through the mail server logs.
In further reading for you, it clearly states that the default PHP mail() function has no type of error tracking
built into it. There are many types of “libraries” that you can use that do full error tracking, but, it does not
appear to be needed. I found that mailing in PHP is usually done using the server’s “sendmail” function. If
you need to check that, you can place a line at the top of any of your pages to show ALL of your PHP
settings. ( use " phpinfo(); " ) You would have to look down the large list for the mailing options. Most
likely, you will find the server log file called “LOG_FILE” at some address like “/my/home/errors.log” … This
means that you need to log into your server’s control panel and look at that address whatever it is. Then,
you will see the errors.log file and you can VIEW it. Look at the bottom of it just after you send your emails.
You will see various logs of errors that the server views as errors or problems. If your mail system did really
have an error, it will be there. If not, then the problem is outside the server and that means either HOTmail
or your email client. TO check HOTMAIL, just change the address to another email account. Try setting up a
temporary email account at Gmail or Yahoo and test using that one. Just use the webmail service for the
one you pick instead of setting up Outlook to handle it. If it goes thru, then it is HOTMAIL. I have seen that
HOTMAIL sometimes do not allow redirection of emails from server to server, so it might be them. Reading
the emails using the webmail service instead of Outlook will rule out Outlook and the local machine it is on.
( webmail just means logging into HOTMAIL, Gmail or Yahoo and reading mail thru the browser! )
Now, that is just about EVERYTHING I know about mail servers. Hope somewhere inside this is the answer
for you. Let us know what happens next with your tests… Good luck!