|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I can not use mail() function in php , Help me please !
// this is a mail file
<html> <head> <title>Trang goi mail</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> </head> <body> <?php $to = "vytien123@yahoo.com"; $from = "vytien83@yahoo.com"; $subject = "This is a test email"; $message = "Dear Vy,\n\nThis is a fake email, I hope you enjoy it.\n\nFrom Tien."; $headers = "From: $from\r\n"; $success = mail($to, $subject, $message, $headers); if ($success) echo "The email to $to from $from was successfully sent"; else echo "An error occurred when sending the email to $to from $from"; ?> </body> </html> // this is result when I run this page Warning: mail() [function.mail]: SMTP server response: 550 Unable to relay in d:\webserver\everyone_web\quanlykhachhang\thu\thumail.php on line 16 An error occurred when sending the email to vytien123@yahoo.com from vytien83@yahoo.com Thanks a lot ![]() |
|
#2
|
|||
|
|||
|
looks like the mail server is refusing the mail because its not sending to the right server. I'm no php expert (check php forum). Are both accounts valid addresses? check smtp server name config in php
|
![]() |
| Viewing: Dev Shed Forums > System Administration > Mail Server Help > I can use mail() function in php , Help me please ! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|