email.class.php 下载,Email Class

参数:$filename (string) – File name

$disposition (string) – ‘disposition’ of the attachment. Most

email clients make their own decision regardless of the MIME

specification used here. https://www.iana.org/assignments/cont-disp/cont-disp.xhtml

$newname (string) – Custom file name to use in the e-mail

$mime (string) – MIME type to use (useful for buffered data)

返回:CodeIgniter\Email\Email instance (method chaining)

返回类型:CodeIgniter\Email\Email

Enables you to send an attachment. Put the file path/name in the first

parameter. For multiple attachments use the method multiple times.

For example:

$email->attach('/path/to/photo1.jpg');

$email->attach('/path/to/photo2.jpg');

$email->attach('/path/to/photo3.jpg');

To use the default disposition (attachment), leave the second parameter blank,

otherwise use a custom disposition:

$email->attach('image.jpg', 'inline');

You can also use a URL:

$email->attach('http://example.com/filename.pdf');

If you’d like to use a custom file name, you can use the third parameter:

$email->attach('filename.pdf', 'attachment', 'report.pdf');

If you need to use a buffer string instead of a real - physical - file you can

use the first parameter as buffer, the third parameter as file name and the fourth

parameter as mime-type:

$email->attach($buffer, 'attachment', 'report.pdf', 'application/pdf');

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
receivemail是一个专门用来接收邮件的PHP类,支持POP3和IMAP等邮件协议。 可以接收邮件及邮件附件。 include("receivemail.class.php"); 02 // 创建一个 reciveMail 对象 03 $obj = new receiveMail('abc@abc.com','xxxxxx','abc@abc.com','pop.abc.com','pop3','110',false); 04 // 连接到邮件服务器 05 $obj->connect(); //If connection fails give error message and exit 06 // 读取未读邮件数 07 $tot = $obj->getTotalMails(); //Total Mails in Inbox Return integer value 08 09 echo "收到$tot封邮件::"; 10 for($i = $tot; $i > 0; $i--) 11 { 12 $head = $obj->getHeaders($i); // 读取获取邮件头信息,返回数组 **数组键值为 (subject,to,toOth,toNameOth,from,fromName) 13 echo "主题 :: ".$head['subject'].""; 14 echo "收件人 :: ".$head['to'].""; 15 echo "抄送 :: ".$head['toOth'].""; 16 echo "发件人 :: ".$head['from'].""; 17 echo "发件人名称 :: ".$head['fromName'].""; 18 echo ""; 19 echo "*******************************************************************************************"; 20 echo $obj->getBody($i); // 邮件正文 21 $str = $obj->GetAttach($i,"./"); // 获取邮件附件,返回的文件名以逗号隔开。 例如. (mailid, Path to store file) 22 $ar = explode(",",$str); 23 foreach($ar as $key=>$value) 24 echo ($value == "") ? "" : "Atteched File :: " . $value . ""; 25 echo "------------------------------------------------------------------------------------------"; 26 //$obj->deleteMails($i); // Delete Mail from Mail box 27 } 28 $obj->close_mailbox(); //Close Mail Box
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值