Send mail with gmail

The 1C:Enterprise developers forum

#1
People who like this:0Yes/0No
Just came
Rating: 1
Joined: Jan 17, 2015
Company: emsteknoloji.com

Hi I want to send mail with gmail but it does not work

Function EmailGönder(Alıcı)
MailMessage = New InternetMailMessage;
MailMessage.Texts.Add(HTML_Text);
MailMessage.Texts.Get(0).TextType = InternetMailTextType.HTML;
MailMessage.From                  = marmara2000burak@gmail.com
MailMessage.SenderName            = marmara2000burak@gmail.com;
MailMessage.Subject  = "Cari Ekstre";
MailMessage.To.Add("marmara2000burak@gmail.com");

InternetMailProfile_ = New InternetMailProfile;
InternetMailProfile_.SMTPServerAddress  = "smtp.gmail.com";
InternetMailProfile_.SMTPPort           = "465";
InternetMailProfile_.SMTPUser   = Constants.SMTPUser.Get();  
InternetMailProfile_.SMTPPassword       = Constants.SMTPPassword.Get();
InternetMailProfile_.Timeout       = 30;
InternetMailProfile_.SMTPUseSSL         = True;
InternetMailProfile_.SMTPAuthentication = SMTPAuthenticationMode.Login;


Mail = New InternetMail();

Try
Mail.Logon(InternetMailProfile_);
Except
Return False;
EndTry;

EndFunction

Edited: BURAK UYANIK - Nov 21, 2017 11:00 PM
 
#2
People who like this:0Yes/0No
Active user
Rating: 7
Joined: Nov 3, 2011
Company: 1C Company

BURAK UYANIK,

please provide more info on this issue:

Your 1C:Enterprise version
Your configuration compatibility mode
The error that you get

 
#3
People who like this:1Yes/0No
Just came
Rating: 0
Joined: May 24, 2013
Company: 1C-Poland Sp. z o.o.

Hi Burak,
Pls check this
https://support.google.com/accounts/answer/6010255?hl=en

Gmail may suppose that 1c is untrusted application

 
#4
People who like this:0Yes/0No
Just came
Rating: 1
Joined: Jan 17, 2015
Company: emsteknoloji.com

Hi! Yulia and Maxim

Thanks Maxim.
"Allow less secure applications: ON" It worked this way.

Thanks Yulia.
1C:Enterprise 8.3.10.2168

 
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)
Be the first to know tips & tricks on business application development!

A confirmation e-mail has been sent to the e-mail address you provided .

Click the link in the e-mail to confirm and activate the subscription.