PHP MYSQL 将文本区域文本附加到电子邮件

发布于 2024-10-09 08:54:10 字数 125 浏览 0 评论 0原文

我正在开发一个 PHP MYSQL 项目工作板,它需要我将简历上传或保存到数据库中。

我想将文本区域 (CV) 字段中的文本附加到电子邮件中并发送给用户。

如何将文本区域文本附加为文档并通过电子邮件发送?

I'm working on a PHP MYSQL project Job board which requires me to upload or save CV into database.

I would like to attach text from a textarea (CV) field to an email and send to user.

How can I attach textarea text as a doc and send it with email?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

何其悲哀 2024-10-16 08:54:10

从数据库中获取简历并保存到 tmp 文件夹。使用邮件库,例如 PHPMailerSwift Mailer 用于撰写和添加附件。

使用这些电子邮件库之一可以大大简化该过程。例如,使用 PHPMailer,发送电子邮件将包括:

$mail = new PHPMailer();
$mail->Host = 'localhost';
$mail->From = '[email protected]'; 
$mail->Mailer   = 'smtp';
$mail->Subject  = 'A Subject';
$mail->Body     = 'Here\'s the CV!';
$mail->AddAddress('[email protected]');
$mail->AddAttachment('/tmp/cv.zip', 'cv.zip');
$mail->Send();

Grab the CV from the database and save to tmp folder. Use a mail library such as PHPMailer or Swift Mailer to compose and add the attachment.

Using one of these email libraries greatly simplifies the process. For instance, using PHPMailer, sending an email would comprise:

$mail = new PHPMailer();
$mail->Host = 'localhost';
$mail->From = '[email protected]'; 
$mail->Mailer   = 'smtp';
$mail->Subject  = 'A Subject';
$mail->Body     = 'Here\'s the CV!';
$mail->AddAddress('[email protected]');
$mail->AddAttachment('/tmp/cv.zip', 'cv.zip');
$mail->Send();
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文