[Gambas-user] using smtp to send mail

T Lee Davidson t.lee.davidson at gmail.com
Thu Dec 5 19:46:19 CET 2019


Also, I don't see your code setting the port, encryption, or authentication method. The following works for me:
   Email.Port = 465
   Email.Authentication = SmtpClient.Plain
   Email.Encrypt = Net.SSL


___
Lee


On 12/5/19 1:08 PM, T Lee Davidson wrote:
> Gmail blocks access from what they call "unsecure applications" by default, if I recall correctly. You may need to log in to 
> your Gmail account and specifically allow connections from unsecure apps.
> 
> 
> ___
> Lee
> 
> 
> On 12/5/19 12:09 PM, Ivan Williams via User wrote:
>>
>> Greetings,
>>
>> I am trying to incorporate a routine within my program to send a email using gmail but I m receiving a 502 error when 
>> activating the routine.
>>
>>    Dim Email As New SmtpClient
>>
>>    Email.Host = "smtp.gmail.com"
>>    Email.User = "joecool at gmail.com"
>>    Email.Password = "snoopy"
>>
>>    Email.From = "joecool at gmail.com"
>>    Email.To.Add("woodstock at yahoo.com")
>>
>>    Email.Subject = "Great Pumpkin"
>>    Email.Body = "Pumpkin Patch"
>>
>>
>> I am getting a 502 when trying to send the email - unable to authenticate error -  can anyone assist or point me in the right 
>> direction.
>>
>> Thank You
>>
>> Ivan    \~/
>>
>> I never saw a wild thing sorry for itself.
>> A small bird will drop frozen dead from a bough
>> Without ever having felt sorry for itself.
>> -- D.H. Lawrence
>>
>>
>> http://www.usconstitution.net/const.html
>>
>> Linux - Live Free or Die.
>>
>>
>>
>> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----
>>


More information about the User mailing list