Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => Mail

If succesful

the mail() function

Moderators: macek, egami, gesf

If succesful

Postby nick_k » Sun Dec 29, 2002 12:25 pm

This is probably something really basic, but here goes anyway. How do I check to see if the mail(); function was succesful, for example, I was to: print("Message succesfully sent!");, if it was succesful.
nick_k
New php-forum User
New php-forum User
 
Posts: 34
Joined: Wed Dec 25, 2002 6:04 am
Location: The Netherlands

Re: If succesful

Postby Joan Garnet » Sun Dec 29, 2002 2:53 pm

Yes, it works like this :
mail() returns TRUE if the mail was successfully accepted for delivery, FALSE otherwise.

Have a look at http://www.php.net/manual/en/function.mail.php

Code: Select all
 if(mail($EMAIL, "$SUBJECT", "$BODY", "From: $REPLY")) { 
            echo "success"; 
 }else{
            echo "fail";
 }     



bye
:)
Last edited by Joan Garnet on Sun Dec 29, 2002 3:04 pm, edited 1 time in total.
User avatar
Joan Garnet
Moderator
Moderator
 
Posts: 387
Joined: Sat Aug 03, 2002 2:56 am
Location: Mars

Postby nick_k » Sun Dec 29, 2002 3:04 pm

thanks for the code!
nick_k
New php-forum User
New php-forum User
 
Posts: 34
Joined: Wed Dec 25, 2002 6:04 am
Location: The Netherlands


Return to PHP coding => Mail

Who is online

Users browsing this forum: No registered users and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron