[RESOLVED] Problem in sending emails
Hello
I have a website and I have email named "[email protected]".
I'm trying to send emails from it by PHP page.
I was using this code:
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=windows-1256\r\n";
$headers .= "From: My Name <[email protected]>\r\n";
$to = The email which I wanna send to... (Hotmail email).
$message = "<html><body><p align=center>Hello</p></body></html>";
mail ($to,"Subject",$message,$headers);
Since days, it was working but now it can't send emails.
Emails never come to receivers.
What's problem, please?
I need help.
Thanks & Regards
Re: Problem in sending emails
Does it work if you try sending it to another email address?
Re: Problem in sending emails
no, it never works even I if used other addresses.
Re: Problem in sending emails
At the top of the script, put the following line. See if you get any errors:
PHP Code:
error_reporting(E_ALL);
Re: Problem in sending emails
Re: Problem in sending emails
Well that rules out a problem with PHP. Is this a Windows or UNIX system? If it is Windows, what SMTP server are you using?
Re: Problem in sending emails
Windows XP.
My smtp I use is "mail.onh1986.com"
Re: Problem in sending emails
have you changed the PHP.ini (ini_set()) file value for the smtp server to use mail.onh1986.com?
Re: Problem in sending emails
How can I change it.
I mean how I can find PHP.ini file and what the code I have to write is.
Thanks
Re: Problem in sending emails
The php.ini file ought to be in your PHP installation location. You can just edit it with a text editor. Search for the phrase "smtp" and follow the instructions in the comments.
Re: Problem in sending emails
Check out these links for info about php.ini. The file is normally in the same folder as the PHP binary file or for windows in the Windows or Winnt folder.
http://uk2.php.net/manual/en/ini.php#ini.list
http://uk2.php.net/manual/en/ref.mail.php#ini.smtp
Re: Problem in sending emails
OK
I couldn't find PHP.ini file in my website.
How can I edit it?
Thanks
Re: Problem in sending emails
Just use ini_set(). You can find thel ocation of php.ini by calling phpinfo() function.
Re: Problem in sending emails
Re: [RESOLVED] Problem in sending emails
i know the thread starter has mark this thread as resolved but i don't want to create a new thread since i'm also having the same problem.
it's not working for me(even after i went through and follow all the given step(s)
i'm on Window XP Pro and i run my scripts locally.
pls help...