How to use error handler for invalid email address

the mail() function

Moderators: macek, egami, gesf

Gian_Piero
New php-forum User
New php-forum User
Posts: 22
Joined: Wed Oct 06, 2004 8:12 am
Location: Surfside,Florida
Contact:

How to use error handler for invalid email address

Postby Gian_Piero » Sat Feb 05, 2005 8:50 am

Hi !
I am trying to code a program using the email() function.
When the first parameter of the calling sequence (the addressee) is not a valid email address, I get a message from the error handler.
How can I code the conditional statements depending on whether I get the message or not (possibly avoiding the message being written on the html page), in other words what is the name and type of the error parameter ?

User avatar
Alexej Kubarev
Site Admin
Site Admin
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län
Contact:

Postby Alexej Kubarev » Sat Feb 05, 2005 1:21 pm

hmmz... tried using basic logic?

Code: Select all

if(@mail($email,$subject,$message,$headers)){
 echo("All done!");
}else{
  echo("Guess what: it failed!");
}


Return to “PHP coding => Mail”

Who is online

Users browsing this forum: No registered users and 1 guest

cron