Can NOT send email
Moderator: General Moderators
Can NOT send email
I can NOT send email using PHP from my computer. I installed Windows2000, IIS, PHP. I can send email using ASP. How com? help please!!!!!!
-
reverend_ink
- Forum Contributor
- Posts: 151
- Joined: Sun Apr 20, 2003 1:18 am
- Location: Las Vegas | London
- evilmonkey
- Forum Regular
- Posts: 823
- Joined: Sun Oct 06, 2002 1:24 pm
- Location: Toronto, Canada
- skylavelle
- Forum Newbie
- Posts: 18
- Joined: Sun May 04, 2003 11:33 pm
- Location: Brisbane, Australia
This one has worked for me.
Cheer
Sky
Code: Select all
<?
mail($toText, $subjectText, $msgText, "To: $toText <someone@somewhere.com>\n" . "From: $fromText <$fromText>\n" . "X-Mailer: PHP 4.x");
?>Sky
In your php.ini..
make sure your smtp server is defined right. localhost would only work if you had a mailSERVER running. try putting your provider's smtp server there. And i don't know if or how the sendmail_from really works, if the above didn't work try commenting it.
Code: Select all
;;;;;;;;;;;;;;;;;;;
; Module Settings ;
;;;;;;;;;;;;;;;;;;;
(..)
їmail function]
; For Win32 only.
SMTP = localhost
; For Win32 only.
sendmail_from = me@localhost.comHi, Thanks your guys.
I tried every possibilities. It seems the bus between PHP and Windows NT.
I newly installed WinXP Professional with IIS and PHP. All I use are default settings. It still doesn't work. I can NOT send email from PHP.
oops.
Thank you anywhere
Maybe I should give up tying and stop using PHP.
doodle
I tried every possibilities. It seems the bus between PHP and Windows NT.
I newly installed WinXP Professional with IIS and PHP. All I use are default settings. It still doesn't work. I can NOT send email from PHP.
oops.
Thank you anywhere
Maybe I should give up tying and stop using PHP.
doodle
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
Have you edited your php.ini as suggested by lcidw? If you don't tell PHP where to find the SMTP server then the mail() function will not work.
Go to your php.ini, it's in the WINDOWS directory, open it in Notepad and find the lines lcidw posted and edit them. You can usually use your ISPs SMTP server (e.g. the one you have setup for your e-mail) for the SMTP value and then you just need to change the sendmail_from address to your e-mail address.
Not all of PHP works straight out of the box, there are tiny things like this that you need to configure yourself.
Mac
Go to your php.ini, it's in the WINDOWS directory, open it in Notepad and find the lines lcidw posted and edit them. You can usually use your ISPs SMTP server (e.g. the one you have setup for your e-mail) for the SMTP value and then you just need to change the sendmail_from address to your e-mail address.
Not all of PHP works straight out of the box, there are tiny things like this that you need to configure yourself.
Mac
Last edited by twigletmac on Tue May 06, 2003 9:22 am, edited 1 time in total.
- skylavelle
- Forum Newbie
- Posts: 18
- Joined: Sun May 04, 2003 11:33 pm
- Location: Brisbane, Australia
Also check wether there is a smtp server where you expect it to be.
Installing IIS does not necessarily mean the mail server has been set up properly (if you want to use it as your MTA)taking the default values (localhost:25) you might try
If not or a connection error occurs there is no mail server running and php isn't to blame
Next step would be to check the mail server's configuration. Is it able to transfer the mails?
Installing IIS does not necessarily mean the mail server has been set up properly (if you want to use it as your MTA)
whatever SMTP is set to in your php.ini try to connect to that host via telnet. The default port is 25 but might have been re-configured in recent versions of php, e.g.php.ini wrote:[mail function]
; For Win32 only.
SMTP = localhost
Code: Select all
їmail function]
; For Win32 only.
SMTP = just.another-ho.st
smtp_port = 125- open a console on your win32-box
- type telnet localhost 25
If not or a connection error occurs there is no mail server running and php isn't to blame
Next step would be to check the mail server's configuration. Is it able to transfer the mails?
Hi,
Thank you all.
I checked the php.ini file. It looks like what you said. everything is fine.
It like the following:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[mail function]
; For Win32 only.
SMTP = localhost ; for Win32 only
; For Win32 only.
sendmail_from = me@localhost.com ; for Win32 only
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
;sendmail_path =
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
I opened a console on your win32-box and typed telnet localhost 25. The following appears on the console.
-----------------------------------
220 ..... ready .....
-----------------------------------
It seems good
I can send email using ASP by object "CDONTS.NewMail" to whatever hotmail or yahoo.
but when I tried using PHP, some times the following Warning appears:
---------------------------------------------------------
Warning: mail() [function.mail]: SMTP server response: 550 5.7.1 Unable to relay for doodleyang@canada.com in F:\Web\email.php on line 8
---------------------------------------------------------
Thank you all again. Please help me again.
Doodle
Thank you all.
I checked the php.ini file. It looks like what you said. everything is fine.
It like the following:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[mail function]
; For Win32 only.
SMTP = localhost ; for Win32 only
; For Win32 only.
sendmail_from = me@localhost.com ; for Win32 only
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
;sendmail_path =
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
I opened a console on your win32-box and typed telnet localhost 25. The following appears on the console.
-----------------------------------
220 ..... ready .....
-----------------------------------
It seems good
I can send email using ASP by object "CDONTS.NewMail" to whatever hotmail or yahoo.
but when I tried using PHP, some times the following Warning appears:
---------------------------------------------------------
Warning: mail() [function.mail]: SMTP server response: 550 5.7.1 Unable to relay for doodleyang@canada.com in F:\Web\email.php on line 8
---------------------------------------------------------
Thank you all again. Please help me again.
Doodle