urgent help needed in configure php.ini for sending MAIL

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
prince09
Forum Newbie
Posts: 7
Joined: Fri Sep 02, 2005 12:24 pm

urgent help needed in configure php.ini for sending MAIL

Post by prince09 »

Hi to all,

I am new to PHP and i want to send simple e-mail using php's mail function. And i get the following error message:
PHP Warning: mail(): "sendmail_from" not set in php.ini or custom "From:" header missing in C:\Inetpub\wwwroot\_debug_tmp.php on line 9

For that I configure the PHP.INI at C:\WINDOWS in this way.

[mail function]
; For Win32 only.
SMTP = 127.0.0.1
smtp_port = 25

; For Win32 only.
;sendmail_from = xyz@abc.com

I am running this code on server and i don't know how to configure SMTP server to send mail?? Can you please help me for this...
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Post by josh »

remove the semi colon infront of sendmail_from, and change it to your email address.
prince09
Forum Newbie
Posts: 7
Joined: Fri Sep 02, 2005 12:24 pm

Post by prince09 »

jshpro2 wrote:remove the semi colon infront of sendmail_from, and change it to your email address.
I remove the semi colon and now it gives this error:

PHP Warning: mail(): Failed to connect to mailserver at "130.207.218.151" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\Inetpub\wwwroot\_debug_tmp.php on line 9

Can anyone plz guide me how to configure SMTP server on Windows XP?

Thanx in advance.
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Post by josh »

What MTA are you using?
Also, did you set sendmail_path? if you set sendmail_path PHP will behave as if it is running on UNIX
prince09
Forum Newbie
Posts: 7
Joined: Fri Sep 02, 2005 12:24 pm

Post by prince09 »

jshpro2 wrote:What MTA are you using?
Also, did you set sendmail_path? if you set sendmail_path PHP will behave as if it is running on UNIX
olaf wrote:hehe.... cool...
Hi, I install SMTP server for Windows 2003 server and now i get this error message:

PHP Warning: mail(): SMTP server response: 550 5.7.1 Unable to relay for chintan_2512@yahoo.com in C:\Inetpub\wwwroot\_debug_tmp.php on line 9

My code is :
<?php
// The message
$message = "Line 1\nLine 2\nLine 3";

// In case any of our lines are larger than 70 characters, we should use wordwrap()
$message = wordwrap($message, 70);

// Send
mail("chintan_2512@yahoo.com", 'My Subject', $message);
?>

and my php.ini file is:

[mail function]
; For Win32 only.
SMTP = 127.0.0.1
smtp_port = 25

; For Win32 only.
sendmail_from = gth838t@mail.gatech.edu


Plz tell me what's the wrong with the code?

Thanx in advance.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I believe Yahoo doesn't accept relay mails... along with pretty much the rest of the world.

http://help.yahoo.com/help/us/mail/defer/defer-02.html
Post Reply