Has anyone written a mail program with an attachment in the Mail class of pear mail? Can you give me an example?
Source: Internet
Author: User
Has anyone written a mail program with an attachment in the Mail class of pear mail? Can you give me an example?
Using the mail.php in pear
Require_once '/var/php/lib/php/mail.php ';
$conf [' mail '] = Array (
' Host ' = ' 163.com ',//SMTP server address, can use IP address or domain name
' Auth ' = True,//true indicates that the SMTP server requires authentication, and false code does not require
' username ' = ' abc ',//user name
' Password ' = ' abc '//Password
);
/***
* Using the $headers array, you can define the contents of the message header, such as using $headers[' reply-to '] to define the reply address
* In this way, it is easy to customize the message header for outgoing mail
***/
$headers [' from '] = ' [email protected] '; Sending address
$headers [' to '] = [email protected]; Delivery address
$headers [' Subject '] = ' hello,everyone '; Message header
$mail _object = &mail::factory (' smtp ', $conf [' Mail ']);
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.