如何通过VB发送电子邮件 [英] How do I send emails through VB

查看:122
本文介绍了如何通过VB发送电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用此代码发送电子邮件,但它返回错误:SMTP服务器需要安全连接或客户端未经过身份验证。服务器响应为:5.5.1需要身份验证。请告诉我我错过了什么或我做错了什么









I tried to use this code to send emails through but it comes back with an error : "The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required". Please tell me what Im missing or what I did wrong




Dim smtp As New SmtpClient("smtp.gmail.com")
        smtp.Port = 587
        smtp.EnableSsl = True
        smtp.Credentials = New System.Net.NetworkCredential("masterchris2685@gmail.com", "PASSWORD CENSORED")
        smtp.Host = "smtp.gmail.com"
        Dim Mail As New MailMessage()
        Mail.To.Add(TextBox1.Text)
        Mail.From = New MailAddress("masterchris2685@gmail.com")
        Mail.Subject = "Activate your account for reverse compatibility - Global Modders"
        Mail.Body = "Thanks for using GlobalModder! We see that you want to activate your account that you have created , Your Password is" + TextBox2.Text
        smtp.Send(Mail)
        MsgBox("Successfully sent activation email.")

推荐答案

打开您的Gmail帐户(masterchris2685@gmail.com)并按照以下说明在您的Gmail帐户中进行一些设置更改..





点击此处 [ ^ ]
Open your gmail account (masterchris2685@gmail.com) and do some setting change in your gmail account as instructed below..


Click here[^]


这篇关于如何通过VB发送电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆