mail

 15 July 11:03   

    The mail action is acclimated to forward E-mail Letters through the SMTP server defined in the php.ini Agreement file.

     bool mail ( cord to, cord subject, cord bulletin [, cord additional_headers [, cord additional_parameters]])

    The alternate boolean will appearance whether the E-mail has been beatific auspiciously or not.

    This archetype will forward bulletin bulletin with the accountable accountable to email abode example@domain.tld. Also, the receiver will see that the eMail was beatific from Example2 and the receiver should acknowledgment to Example3

    
     mail(

     example@domain.tld, // E-mail address

     subject, // Subject

     message, // Message

     From: Example2
Reply-to: Example3 ) // Added Headers

     ;

     ?>

    There is no claim to address E-mail addresses in architecture Name , you can just address email.

    This will forward the aforementioned bulletin as the first archetype but includes From: and Reply-To: headers in the message. This is appropriate if you wish the being you beatific the E-mail to acknowledgment to you. Also, some E-mail providers will accept mail is spam if assertive headers are missing so unless you cover the actual headers you mail will end up in the clutter mail folder.

    Especially if sending assorted emails, such as for a newsletter script, absurdity apprehension is important.

    Use this Software to forward mail while admonishing for errors:

     $result=@mail($to,$subject,$message,$headers);

     if ( $result ) answer Email beatific successfully.

     abroad answer Email was not sent, as an absurdity occurred.

    In the case beneath the Software has already got a account of emails, we artlessly use the aforementioned action for using a bend in PHP with mysql results. The Software beneath will attack to forward an email to every individual email abode in the arrangement until it runs out.

     while ($row = mysql_fetch_assoc($result))

    Then if we accommodate the absurdity blockage into the assorted email Software we get the following

     $errors = 0

     $sent = 0

     while ($row = mysql_fetch_assoc($result))

     answer You accept beatific $sent messages;

     answer About there area $errors messages;

    [http://www.php.net/manual/en/ref.mail.php PHP Manual: Mail Functions]

    

 


Tags: subject, errors, message, messages, string, script, result

 email, message, script, string, headers, result, subject, mysql, messages, error, errors, , fetch assoc result, mysql fetch assoc, row mysql fetch,

Share mail: Digg it!   Google Bookmarks   Del.icio.us   Yahoo! MyWeb   Furl  Binklist   Reddit!   Stumble Upon   Technorati   Windows Live   Bookmark

Text link code :
Hyper link code:

Also see ...

Permalink
Article In : Computers & Technology  -  Websites Help