I have this contact.php file which processes the data coming from a form. This file tries to send the entered information to an email using PHPMailer (If they are validated). here is the code snippet:
and here is the error it throws:
I am new at this so please give me a clear answer or examples! I have searched a lot, but still couldn't solve it!
any help or suggestion would be deeply appreciated!
Thank you so much!
1) Are you sure you have the correct hostname? Try doing
and see if you get a result. (The name lookes starnage to me, usually the last part should be .com)
2) Are you sure that port 25 is open and not blocked by a firewall? Try this to see if the port is accessible:
telnet mail.mysite.co 25
If it accessible you will get some result (gibbersh, screen refresh). If the port is not accessible, you will get a connection error.
3) Are you sure you have the correct username and password (email@example.com/mysite23) to connect to mail server? Some mail servers only want the name and not the "@hostname" portion to log in.
4) Do you own mail.mysite.co? If so, what OS is it running? If you don't own it, are you sure that you have access to it? I ask because if that site is running MS Exchange you might not have the necessary access rights (I run into that all the time at work - I cannot programmatically access the same Exchange server that Outlook has access to so we have configured a gateway system that we use when testing email code or configuring other apps to send emails).