Ошибка: The SMTP host was not specified
Почему выдает ошибку? Что здесь не так?
- Код: Выделить всё
Private Sub mail1()
Dim AttachFileName As String
Dim AdrTo As String
Dim AdrFrom As String
Dim MailSubj As String = "License"
Dim MailBody As String = "It is Yours new licemse" & Chr(13) & "Do not repli"
AdrTo = "mislev@netvision.net.il"
AdrFrom = "labitap@gmail.com"
Dim message As New System.Net.Mail.MailMessage(AdrFrom, AdrTo, MailSubj, MailBody)
AttachFileName = "D:\PROJEKTS\VB - NET\EmailSender\bin\Debug\SoursesAddresses.txt"
message.Attachments.Add(New System.Net.Mail.Attachment(AttachFileName))
Dim instance As New System.Net.Mail.SmtpClient
Dim SmtpClientName As String
instance.Host = "smtp.gmail.com"
SmtpClientName = instance.Host
emailClient.Send(AdrFrom, AdrTo, MailSubj, MailBody)
'Ошибка: The SMTP host was not specified
' Почему выдает ошибку? Что здесь не так?
End Sub
Благодарю за внимание!