JMail Components for PHP mail delivery (transcoding support)

Source: Internet
Author: User
Tags email account

<?php
$jmail =new COM ("Jmail.message") or Die ("Cannot invoke JMail component");
Masking exception errors, silent processing
$jmail->silent=true;
Encoding must be set, otherwise Chinese will be garbled
$jmail->charset= "Utf-8";
Sender e-mail address and name, can be customized, can be different from the mail sending account

$jmail->from= "";
$jmail->fromname= "webmaster";
//Add multiple message Recipients
$jmail->addrecipient ("");
Message subject and body information
$jmail->subject=mb_convert_encoding ($mailtitle, ' GB2312 ', ' UTF-8 ');  
$jmail->body= Mb_convert_encoding ($mailcontent, ' GB2312 ', ' UTF-8 ');  
//email account and password
$jmail->mailserverusername= "";
$jmail->mailserverpassword= "******";
try{
   //Send with SMTP sender server address
    $retval = $jmail->send (" Smtp.mail.xxx.com ");
    if ($retval)
    echo "Send succeeded";
    Else
    echo "Send Failed";
} catch (Exception $e) {
    echo $e->getmessage ();
}
?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.