Tag: SMTP

邮件多部分/替代与多部分/混合

在创build电子邮件时,您应该在发送HTML和TEXT或发送文本和附件时使用multipart/mixed将Content-Type设置为multipart/alternative 。 那么如果你想发送HTML,文本和附件,你会怎么做? 同时使用?

港口465和587有什么区别?

这些端口465和587都用于发送邮件(提交邮件),但它们之间的真正区别是什么?

我怎样才能使SMTPvalidation在C#

我创build了使用SMTP发送消息的新的ASP.NET Web应用程序。 问题是smtp没有通过谁发送消息进行身份validation。 我如何使我的程序中的SMTPvalidation? C#有一个类有input用户名和密码的属性吗?

用附件从C#发送电子邮件,附件到达Thunderbird的第1.2部分

我有一个C#应用程序,通过使用SMTP通过Exchange 2007服务器发送Excel电子表格报告。 这些邮件适用于Outlook用户,但是对于Thunderbird和Blackberry用户,附件已被重命名为“第1.2部分”。 我发现这篇文章描述了这个问题,但似乎并没有给我一个解决方法。 我没有Exchange服务器的控制权,所以不能在那里进行更改。 有什么我可以做的C#结束? 我曾尝试使用短文件名和HTML编码的身体,但都没有作出改变。 我的邮件发送代码是这样的: public static void SendMail(string recipient, string subject, string body, string attachmentFilename) { SmtpClient smtpClient = new SmtpClient(); NetworkCredential basicCredential = new NetworkCredential(MailConst.Username, MailConst.Password); MailMessage message = new MailMessage(); MailAddress fromAddress = new MailAddress(MailConst.Username); // setup up the host, increase the timeout to 5 minutes smtpClient.Host = MailConst.SmtpServer; […]

WAMP使用SMTP本地主机发送邮件

我需要使用PHP mail()函数发送邮件从本地SMTP(使用Wamp,Xampp等..)。 有人可以给教程吗?

SMTP服务器需要安全的连接或者客户端没有被authentication。 服务器响应是:5.5.1需要身份validation?

我想从我的应用程序发送一封电子邮件,我已经编写了以下用于发送邮件的代码 MailMessage msg = new MailMessage(); msg.From = new MailAddress("mymailid"); msg.To.Add("receipientid"); msg.Subject = "test"; msg.Body = "Test Content"; msg.Priority = MailPriority.High; SmtpClient client = new SmtpClient(); client.Credentials = new NetworkCredential("mymailid", "mypassword", "smtp.gmail.com"); client.Host = "smtp.gmail.com"; client.Port = 587; client.DeliveryMethod = SmtpDeliveryMethod.Network; client.EnableSsl = true; client.UseDefaultCredentials = true; client.Send(msg); 我在本地主机上运行它,所以我正在做什么错误来发送它。 当我发送button,它会给出一个错误 SMTP服务器需要安全的连接或者客户端没有被authentication。 服务器响应是:5.5.1需要身份validation。 在Web.config文件中的代码 <appSettings> <add […]

return-path,reply-to和from之间的行为差​​异是什么?

在我们的邮件应用程序中,我们发送带有以下标题的电子邮件: FROM: marketing@customer.com TO: subscriber1@domain1.com Return-PATH: bouncemgmt@ourcompany.com 我们面临的问题是,一些电子邮件服务器会立即反弹消息,并使用反向path(marketing@customer.com)而不是我们的反弹pipe理服务器。 我们想要知道,如果我们能够捕获所有的反弹,我们是否在标题中修改了答复 – 与返回path相同。 任何其他的想法,欢迎? 我们使用以下文档作为参考: VERP RFC Bounce消息 SMTP日志parsing来获取反弹 编辑1:多一点的信息,看看我们是否可以得到这个决心。 我们想知道中继邮件的电子邮件服务器将select使用回复还是回复path。 我们已经注意到,当中继消息的第一个smtp服务器被拒绝时,它将它发送给回复,但是当它发生在一跳后,它将它发送到返回path。

使用Javamail连接到Gmail的SMTP服务器忽略指定的端口,并尝试使用25

我试图在groovy脚本中使用javamail通过gmail发送电子邮件。 我在网上查了很多地方,到目前为止一直无法工作。 我在运行脚本时遇到的错误是: DEBUG SMTP: useEhlo true, useAuth false DEBUG SMTP: trying to connect to host "smtp.gmail.com", port 25, isSSL false Caught: javax.mail.SendFailedException: Send failure (javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 25 (javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?)) 它似乎试图使用端口25,即使我已经指定它应该使用端口587.有谁知道什么可能导致这个问题,我用telnet连接到端口587 smtp服务器,和雷鸟使用端口587具有STARTTLS安全性,并能够使用SMTP服务器成功发送邮件。 这告诉我,这不是一个阻塞的端口或连接问题。 以下是我用来尝试发送电子邮件的代码: import javax.mail.* import javax.mail.internet.* private class SMTPAuthenticator extends Authenticator { […]

在JAVA中通过gmail smtp服务器发送电子邮件

这个代码有什么问题? 不知何故,它正在进入Transport.send(message);行无限循环Transport.send(message); 行,没有错误信息,没有例外,也许是无限循环(我不知道,因为我不等待超过5-10分钟) final String username = "<mail_name>"; final String password = "<password>"; Properties props = new Properties(); props.put("mail.smtp.auth", "true"); props.put("mail.smtp.starttls.enable", "true"); props.put("mail.smtp.host", "smtp.gmail.com"); props.put("mail.smtp.port", "465"); Session session = Session.getInstance(props, new javax.mail.Authenticator() { protected PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication(username, password); } }); try { Message message = new MimeMessage(session); message.setFrom(new InternetAddress("<mail_from>@gmail.com")); message.setRecipients(Message.RecipientType.TO, InternetAddress.parse("<mail_to>@gmail.com")); message.setSubject("Test […]

使用Gmail帐户的XAMPP Sendmail

我试图通过XAMPPconfigurationSendmail发送电子邮件。 在我的sendmail.ini中我有这些设置: # Set default values for all following accounts. logfile "C:\xampp\sendmail\sendmail.log account Gmail tls on port 587 tls_certcheck off host smtp.gmail.com from myemail@gmail.com auth on user myemail06@gmail.com password mypassword account default : Gmail 我已经创build了如下的testing脚本: $to = "testemail@btinternet.com"; $subject = "Hi!"; $body = "Hi,\n\nHow are you?"; $headers = "From: myemail06@gmail.com" . "\r\n"; if (mail($to, $subject, […]