这篇文章主要介绍了ZF框架实现发送邮件的方法,实例分析了Zend Framework使用smtp邮件类实现邮件发送的相关技巧,具有一定参考借鉴价值,需要的朋友可以参考下
Zend_Loader::loadFile("Zend/Mail.php"); Zend_Loader::loadFile("Zend/Mail/Transport/Smtp.php"); $config = array( 'auth' => 'login', 'username' => 'username@163.com', 'password' => 'password', ); $transport = new Zend_Mail_Transport_Smtp('smtp.163.com', $config); $mail = new Zend_Mail(); $mail->setBodyText("this is body text", "utf-8"); $mail->setFrom("username@163.com", "loopercopper"); $mail->addTo('wiseideal@163.com', "andy"); $mail->setSubject("testSubject"); $mail->send($transport);
解决主题乱码的方式:
复制代码 代码如下:
$mail->setSubject("=?UTF-8?B?".base64_encode("中文消息")."?=");

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Dreamweaver CS6
Visual web development tools

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

SublimeText3 Chinese version
Chinese version, very easy to use

Atom editor mac version download
The most popular open source editor