Tag: 电子邮件附件

在C#中设置电子邮件附件名称

我添加这样的附件: System.Net.Mail.Attachment attachment = new System.Net.Mail.Attachment(AttachmentPath); msg.Attachments.Add(attachment); 但我想把它作为一个不同的名称附加,实际的文件名非常长,令人困惑,我想它附加为“file.txt”,是否有一个简单的方法来做到这一点,而不必做一个副本文件?

如何在电子邮件正文中添加图片

我想在电子邮件正文中添加一个图像。 我不想将图像附加到电子邮件,但在电子邮件正文中添加图像。 这个怎么做? 我正在使用这个。 "<img src=\"data:image/png;base64,"+convertFileTOByteEncrypt()+"\">" 要么 "<img src=\"http://images.anandtech.com/doci/3982/HTCSurround-0134.jpg\">" 然后图像显示像这样。

如何使用PHP发送附件的电子邮件?

我正在使用下面的代码发送电子邮件与附件,但适当的文件不附加邮件。 $UnidID = $_COOKIE['UniqueID']; $guid = $_COOKIE['guid']; $target_path = "userdata/".$UniqueID."/".$iGuid."/Outputs"; $fname = getpathmail($UnidID,$guid); $target_path = $target_path.$filname; $fileatt_type = "application/fbf"; // File Type $fileatt_name = $fname; $data = $target_path; $email_from = "EHPAdmin@fugro.in"; $email_subject = "EHP/PPP process"; $email_message = "Processed result for EHP/PPP processing"; $email_to = $_GET['Email'] ; $headers = "From: ".$email_from; $semi_rand = md5(time()); $mime_boundary = […]

如何附加两个或多个文件,并在PHP中发送邮件

下面的代码只发送一个附件,但我需要附加并发送两个文件(一个rar文件和pdf) $email_to = "$email"; // The email you are sending to (example) $email_from = "online@example.co.in"; // The email you are sending from (example) $email_subject = "subject line"; // The Subject of the email $email_txt = "text body of message"; // Message that the email has in it $fileatt = "files/example.rar"; // Path to the file […]

从表单发送文件附件使用phpMailer和PHP

我有一个example.com/contact-us.php上的表单,看起来像这样(简化): <form method="post" action="process.php" enctype="multipart/form-data"> <input type="file" name="uploaded_file" id="uploaded_file" /> <input type="hidden" name="MAX_FILE_SIZE" value="10000000" /> </form> 在我的process.php文件中,我有下面的代码利用PHPMailer()发送一封电子邮件: require("phpmailer.php"); $mail = new PHPMailer(); $mail->From = me@example.com; $mail->FromName = My name; $mail->AddAddress(me@example.com,"John Doe"); $mail->WordWrap = 50; $mail->IsHTML(true); $mail->Subject = "Contact Form Submitted"; $mail->Body = "This is the body of the message."; 电子邮件正确发送正文,但没有upload_file的附件。 我的问题 我需要将表单中的文件uploaded_file附加到电子邮件中,然后发送。 在process.php脚本在电子邮件中发送它之后,我不关心保存文件。 我明白,我需要添加AddAttachment(); 某处(我正在假设在Body线下)附件发送。 […]