How to use gmail SMTP in ASP.NET form

前端 未结 7 594
眼角桃花
眼角桃花 2020-12-04 02:00

I am a ASP novice and am troubleshooting a form for work. None of us here are ASP experts as we use PHP. But I am on the bottom of PHP experience as well, mostly working wit

7条回答
  •  离开以前
    2020-12-04 02:46

    Try this.

    Dim client As New Net.Mail.SmtpClient
    client.UseDefaultCredentials = False
    client.Credentials = New System.Net.NetworkCredential("sender@gmail.com", "password")
    client.Host = "smtp.gmail.com"
    client.Port = 587
    client.EnableSsl = True
    client.Send("sender@gmail.com","reciever@gmail.com","subject","body")
    

提交回复
热议问题