drips / 邮件
基于 PhpMailer 的 PHP 邮件系统
v1.0.0
2016-07-22 14:44 UTC
Requires
- php: >=5.4
- drips/config: ^1.0
- phpmailer/phpmailer: ~5.2
This package is not auto-updated.
Last update: 2024-09-26 00:11:42 UTC
README
描述
基于 PHPMailer 的邮件发送器。
配置
mail_smtp- 指定是否使用 SMTP 服务器 (true/false)mail_smtp_host- SMTP 主机mail_smtp_auth- 指定是否需要认证 (true/false)mail_smtp_username- 用户名mail_smtp_password- 密码mail_smtp_secure- 加密mail_smtp_port- 端口mail_from_email- (可选) 默认发送电子邮件的电子邮件地址mail_from_name- (可选) 显示的发送者名称mail_cc- (可选) 发送到多个收件人的邮件副本mail_bcc- (可选) 邮件的盲抄本
示例
<?php use Drips\Mail\Mail; $mail = new Mail; $mail->addAddress('test@prowect.com', 'Test'); // Empfänger hinzufügen (zweiter Parameter ist optional); $mail->addReplyTo('test@prowect.com', 'Test'); // Empfänger der Antwort-Email $mail->addAttachment('/test/image.png'); // Anhang hinzufügen $mail->isHTML(true); // HTML Email Format $mail->Subject = 'Here is the subject'; // Betreff $mail->Body = 'This is the body for HTML mail clients'; // Nachricht $mail->AltBody = 'This is the body in plain text for non-HTML mail clients'; // Alternativ wenn HTML nicht unterstützt wird if(!$mail->send()) { // Email konnte nicht gesendet werden } else { // Email wurde erfolgreich gesendet }