- 最後登錄
- 2023-4-24
- 在線時間
- 186 小時
- 註冊時間
- 2008-4-1
- 閱讀權限
- 20
- 精華
- 0
- UID
- 3887184
- 帖子
- 372
- 積分
- 21 點
- 潛水值
- 5911 米
| 如果發覺自己無法使用一些功能或出現問題,請按重新整理一次,並待所有網頁內容完全載入後5秒才進行操作。 網路上找的,試一下吧!- Imports System.Net.Mail
- Public Class Form1
- Private Sub Button1_Click(ByVal sender As System.Object, _
- ByVal e As System.EventArgs) Handles Button1.Click
- Try
- Dim SmtpServer As New SmtpClient()
- Dim mail As New MailMessage()
- SmtpServer.Credentials = New _
- Net.NetworkCredential("username@gmail.com", "password")
- SmtpServer.Port = 587
- SmtpServer.Host = "smtp.gmail.com"
- mail = New MailMessage()
- mail.From = New MailAddress("YOURusername@gmail.com")
- mail.To.Add("TOADDRESS")
- mail.Subject = "Test Mail"
- mail.Body = "This is for testing SMTP mail from GMAIL"
- SmtpServer.Send(mail)
- MsgBox("mail send")
- Catch ex As Exception
- MsgBox(ex.ToString)
- End Try
- End Sub
- End Class
複製代碼 ... |
|