i need to send an email using a php code. so this is how my php code looks like

   
<?php $to = "myAddress@hotmail.com"; echo "1"; $subject = "Hi!"; echo "2"; $body = "Hi,\n\nHow are you?"; echo "3"; if (mail($to, $subject, $body)) { echo "4"; echo("<p>Message successfully sent!</p>"); } else { echo "6"; echo("<p>Message delivery failed...</p>"); } ?>

wen i run the script i get a message that "message delivery failed" .. this is because that i have not configured the php.ini file properly to send mails,, does any one know how to do this ..
my OS is windows XP, i have installed apache server 2.0X .. i have both hotmail and gmail acount.

this is how my php.ini file looks like

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

; For Win32 only.
sendmail_from = shaenator7@hotmail.com

; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
;sendmail_path =

; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
; the 5th parameter to mail(), even in safe mode.
;mail.force_extra_parameters =

    the problem is that in order to send an email you need a mail server.

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

    See php.ini thinks that there is a mail server running on localhost. But that's not true, is it?

    You can use your ISPs smtp server instead.

    http://email.about.com/cs/phpemailtips/qt/et021802.htm

      Write a Reply...