标签: smtp-auth

SMTP服务器需要安全连接或客户端未经过身份验证.服务器响应为:5.5.1需要身份验证.

可能重复:
SMTP服务器需要安全连接或客户端未经过身份验证.服务器响应为:5.5.1需要身份验证

我运行此代码时出现问题,然后发生错误"SMTP服务器需要安全连接或客户端未经过身份验证.服务器响应为:5.5.1需要身份验证."

我的代码是:

protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{

    MailMessage mail = new MailMessage();
    mail.To.Add("info@msslindia.com");
    mail.From = new MailAddress("info@msslindia.com");
    string body = "<table><tr><td>Company Name:</td><td>" + txt_cname.Text + "</td></tr><tr><td>Address With No.:</td><td>" + txt_addwithno.Text + "</td></tr><tr><td>Contact Person:</td><td>" + txt_conperson.Text + "</td></tr><tr><td>Email Id</td><td>" + txt_email.Text + "</td></tr><tr><td>Description</td><td>" + txt_description.Text + "</td></tr></table>";
    mail.Body = body;
    mail.IsBodyHtml = true;
    SmtpClient smtp = new SmtpClient();
    smtp.Host = "smtp.gmail.com";
    smtp.Port = 587;

    smtp.Credentials = new System.Net.NetworkCredential("info@msslindia.com", "12345");
    smtp.EnableSsl = true;
    smtp.Send(mail);


    txt_cname.Focus();
    txt_cname.Text = …
Run Code Online (Sandbox Code Playgroud)

c# gmail sql-server-2008 smtp-auth

7
推荐指数
1
解决办法
2万
查看次数

使用java验证smtp服务器凭据,而不实际发送邮件

要验证smtp服务器凭据,我应该使用transport.connect()

Session session = Session.getInstance(properties,authenticator);

 Transport tr=session.getTransport("smtp");

 tr.connect();
Run Code Online (Sandbox Code Playgroud)

检查smtp服务器凭据是否正确?

java jakarta-mail smtp-auth

6
推荐指数
2
解决办法
1万
查看次数

已请求SMTP-AUTH但缺少用户名

目前我正在做Daniel Kehoe的Learn Ruby on Rails教程.其中一项练习是使用Google的Gmail帐户从"联系"页面发送联系表单.

但是,当我发送联系表单而不是在我的邮箱中收到电子邮件时,我收到此错误:

"SMTP-AUTH已请求但缺少用户名"

在我的config/application.yml文件中,我设置了Gmail用户名和密码.

有谁知道可能是什么问题?

谢谢你的帮助,

安东尼

smtp-auth learn-ruby-on-rails

6
推荐指数
2
解决办法
4572
查看次数

Go:连接到SMTP服务器并在一个连接中发送多个电子邮件?

我正在编写一个程序包,我打算与本地SMTP服务器建立一个初始连接,然后等待一个通道,该通道将填充电子邮件,以便在需要发送时发送.

查看net/http似乎期望每次发送电子邮件时都应拨打SMTP服务器并进行身份验证.当然,我可以拨打和验证一次,保持连接打开,只是添加新的电子邮件?

看看源代码smtp.SendMail,我不知道如何做到这一点,因为似乎没有办法回收*Client:http: //golang.org/src/net/smtp/smtp.go?s = 7610:7688#L263

有一个Reset功能*Client,但其描述是:

 Reset sends the RSET command to the server, aborting the current mail transaction.
Run Code Online (Sandbox Code Playgroud)

我不想中止当前的邮件交易,我希望有多个邮件交易.

如何保持与SMTP服务器的连接打开并在该连接上发送多封电子邮件?

email smtp go smtp-auth

6
推荐指数
1
解决办法
2814
查看次数

无法从Win7上的Windows服务发送SMTP电子邮件

我正在使用c#.NET 4.0编写Windows服务(我的开发工作站是Windows 7).目的是在处理过程中出现错误时直接从服务发送电子邮件.我已经包含了一个代码片段来展示我想要实现的目标:

try
        {
                string emailAddresses = "me@sample.com";
                string emailCCAddresses = "you@sample.com";

                //Send the email
                using (MailMessage mailMsg = new MailMessage())
                {
                    mailMsg.To.Add(emailAddresses);
                    mailMsg.From = new MailAddress("winService@sample.com");
                    mailMsg.CC.Add(emailCCAddresses);
                    mailMsg.Subject = " Error Message ";
                    mailMsg.Body = DateTime.Now + " : Invalid File Encountered." ;

                    ////Creating the file attachment
                    using (Attachment data = new Attachment("C:\\users\\sample.xml", MediaTypeNames.Application.Octet))
                    {
                        //Add timestamp info for the file
                        ContentDisposition disposition = data.ContentDisposition;
                        disposition.ModificationDate = File.GetLastWriteTime("C:\\users\\sample.xml");
                        mailMsg.Attachments.Add(data);

                    SmtpClient emailClient = new SmtpClient("example.Sample.com", 25);
                    emailClient.DeliveryMethod = SmtpDeliveryMethod.Network; …
Run Code Online (Sandbox Code Playgroud)

c# email smtp windows-7 smtp-auth

5
推荐指数
1
解决办法
6778
查看次数

通过未加密的连接发送电子邮件

我有一个不使用加密连接的SMTP帐户.我可以使用相同的帐户从C#和Python发送电子邮件没有问题,但使用Go我得到错误: 未加密的连接

这是我正在使用的代码:

package main

import (
        "log"
        "net/smtp"
)

func main() {
        // Set up authentication information.
        auth := smtp.PlainAuth(
                "",
                "user@example.com",
                "password",
                "mail.example.com",
        )
        // Connect to the server, authenticate, set the sender and recipient,
        // and send the email all in one step.
        err := smtp.SendMail(
                "mail.example.com:25",
                auth,
                "sender@example.org",
                []string{"recipient@example.net"},
                []byte("This is the email body."),
        )
        if err != nil {
                log.Fatal(err)
        }
}
Run Code Online (Sandbox Code Playgroud)

go smtp-auth

5
推荐指数
1
解决办法
5331
查看次数

使用 Outlook SMTP 发送电子邮件

我想使用 Outlook 的 SMTP 服务器在 Django 应用程序中发送电子邮件。问题是,每次尝试发送消息时,我都会收到SSL 错误的版本号错误。

错误回溯:

Traceback (most recent call last):
File "F:\Development\Python\lib\smtplib.py", line 366, in getreply
    line = self.file.readline()
File "F:\Development\Python\lib\socket.py", line 297, in readinto
    return self._sock.recv_into(b)
File "F:\Development\Python\lib\ssl.py", line 453, in recv_into
    return self.read(nbytes, buffer)
File "F:\Development\Python\lib\ssl.py", line 327, in read
    v = self._sslobj.read(len, buffer)
ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1450)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "F:\Development\Python\lib\site-packages\django\core\handlers\base.py", line 115,   in get_response
    response …
Run Code Online (Sandbox Code Playgroud)

django smtp-auth django-email

5
推荐指数
2
解决办法
9631
查看次数

使用Outlook.com SMTP发送电子邮件

我正在尝试使用Outlook.com smtp支持发送自动电子邮件.但是我得到以下异常:

System.Net.Mail.SmtpException: Failure sending mail.  
---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.  
---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host" Exception while sending email.
Run Code Online (Sandbox Code Playgroud)

我的代码:

    public bool SendEmail(MailMessage msg)
    {
        try
        {
            SmtpClient smtpClient = new SmtpClient("smtp-mail.outlook.com")
            {
                UseDefaultCredentials = false,
                DeliveryMethod = SmtpDeliveryMethod.Network,
                Credentials = new NetworkCredential("userAddress", "userPassword"),
                Port = 587,
                EnableSsl = true,
            };
            smtpClient.Send(msg);
            msg.Dispose();
            smtpClient.Dispose();
            return true;
        } …
Run Code Online (Sandbox Code Playgroud)

c# email smtpclient smtp-auth outlook.com

5
推荐指数
1
解决办法
1万
查看次数

SMTP身份验证错误:SASL身份验证失败:密码验证失败

我有一个运行postfix + dovecot作为邮件服务器的VPS服务器.我已经创建了两个运行良好的帐户.两者都可以通过STARTTLS和SSL发送和接收电子邮件.

但是,当我今天添加第三个帐户时,它只能接收电子邮件但无法连接SMTP服务器.所以这不是密码错误的问题.SMTP设置与其他两个帐户相同.客户端的设置应该是正确的.

后缀日志说:

Aug 28 12:55:32 server postfix/smtpd[1645]: warning: SASL authentication failure: Password verification failed
Aug 28 12:55:32 server postfix/smtpd[1645]: warning: unknown[203.97.197.232]: SASL PLAIN authentication failed: authentication failure
Aug 28 12:55:35 server postfix/smtpd[1645]: warning: unknown[203.97.197.232]: SASL LOGIN authentication failed: authentication failure 
Run Code Online (Sandbox Code Playgroud)

main.cf中的sasl和tls设置为:

smtpd_sasl_auth_enable = yes
smtpd_sasl_type = cyrus
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_sasl_authenticated_header = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
smtpd_tls_auth_only = no
smtp_use_tls = yes
smtpd_use_tls = yes
smtp_tls_note_starttls_offer = yes
smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key
smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt …
Run Code Online (Sandbox Code Playgroud)

postfix-mta smtp sasl cyrus smtp-auth

5
推荐指数
0
解决办法
1786
查看次数

我如何告诉 Prometheus 的 Alertmanager 通过 Gmail 的 SMTP 服务器发送电子邮件

当指标超过特定阈值时,我希望 Prometheus 从 Gmail (Gapps) 帐户发送电子邮件。在Alertmanager 配置文档中,没有提到密码。如何对 SMTP 服务器进行身份验证?

gmail smtp smtp-auth prometheus

5
推荐指数
1
解决办法
1万
查看次数