Código vb:
Ver original
Public Class clsMailSender Const GMAILUSER = "[email protected]" Const GMAILPASS = "your_password" Const GMAILSMTPHOST = "smtp.gmail.com" Const GMAILSMTPPORT = 587 Const GMAILbEnableSSL = True 'Si no funciona por el puerto SMTP 587, prueba con el 25 Public Function SendEmailGMAIL(ByVal MailSubject As String, ByVal MessageBody As String, ByVal ToAddresses As String) As Boolean 'SendEmailGMAIL("subject","messagebody","address1;address2;...") Try Dim Mail As New MailMessage() Mail.Subject = MailSubject Mail.From = New System.Net.Mail.MailAddress(GMAILUSER) For Each Address As String In Split(ToAddresses, ";") Mail.To.Add(Address) Next Mail.Body = MessageBody Dim SmtpServer As New SmtpClient() SmtpServer.Credentials = New Net.NetworkCredential(GMAILUSER, GMAILPASS) SmtpServer.Host = GMAILSMTPHOST SmtpServer.Port = GMAILSMTPPORT SmtpServer.EnableSsl = GMAILbEnableSSL SmtpServer.Send(Mail) Return True Catch ex As Exception Console.WriteLine(ex.Message) Return False End Try End Function End Class
No tengo problemas con el codigo pero si hay que modificar algo lo pongo
Veran, gmail me dice que se bloqueo intentos de inicio de sesion y que debo permitir aplicaciones no seguras, pero aun asi no funciona.}
hay alguna manera de decirle a gmail que deje mandar correos automaticos?
de antemano gracias