Dim mailmsg As New System.Net.Mail.MailMessage()
mailmsg.From = New MailAddress("[email protected]")
mailmsg.To.Add("to.domain.com")
mailmsg.Subject = "Mail From .Net Application"
mailmsg.IsBodyHtml = True
mailmsg.Body = "Hi this is a mail from .net appl i have used same code......"
mailmsg.Priority = MailPriority.Normal
Dim client As New System.Net.Mail.SmtpClient()
client.UseDefaultCredentials = False
client.Credentials = New System.Net.NetworkCredential("[email protected]", "password")
client.Port = "587"
client.Host = "smtp.gmail.com"
client.EnableSsl = True
Dim userstate As Object = mailmsg
client.Send(mailmsg)
如果我的smtp有問題,你們可以檢查我的代碼嗎?然後我 想添加一些代碼的附件文件誰能幫助?如何在vb.net中創建自動發送電子郵件?
歡迎來到StackOverflow。這個網站是不是* plz給我的codez *問題。請參加[導覽]並閱讀[幫助]頁面,尤其是[問]。謝謝。 –
https://www.google.co.uk/search?client=ubuntu&channel=fs&q=send+email+in+v.net&ie=utf-8&oe=utf-8&gfe_rd=cr&ei=5O7iWMGcBKWN8Qe8-biwDg#channel=fs&q=send +電子郵件+在+ vb.net&* – ADyson