Desktop version

Main > Forum > 1C:Enterprise Platform > 1C:Enterprise – Business applications platform > Email using Sendgrid

Forum

Search UsersRules
Email using Sendgrid
#1
Just came
Points:: 0
Joined:: Jun 13, 2023

Good Morning,

I am having an issue by sending emails from 8.3.10.2168 after 07/06/2023. Previously I was using the following code without any issues but after that date i am getting the following error:
"This operation cannot be performed because no SMTP server address has been specified."

MailMessage = New InternetMailMessage;
MailMessage.To.Add(<To Email Address>);
MailMessage.From.Address = <From Email Address>;
MailMessage.Subject = <Subject Name>;
text=<General Text>;
MailMessage.Texts.Add(text);  


Profile = New InternetMailProfile;
Profile.SMTPPassword=<SMTP Password>;
Profile.SMTPPort=587;
Profile.SMTPServerAddress="smtp.sendgrid.net";
Profile.SMTPAuthentication= smtpauthenticationmode.Default;
Profile.SMTPUser=<SMTP User>;

Mail = New InternetMail;
Mail.Logon(Profile);

Mail.Send(MailMessage);

Do know how to resolve this error?

Profile
#2
Administrator
Points:: 0
Joined:: Oct 3, 2019

Hello Petros,

perhaps the reason is that the settings of your mail server have changed.

Try the following code:

Code
Profile = New InternetMailProfile;

Profile.SMTPPort = 587;
Profile.IMAPPort = 0;
Profile.POP3Port = 0;

Profile.POP3BeforeSMTP    = False;
Profile.IMAPServerAddress = "";
Profile.POP3ServerAddress = "";
Profile.SMTPServerAddress = "smtp.sendgrid.net";

Profile.POP3Authentication = POP3AuthenticationMode.General;
Profile.SMTPAuthentication = SMTPAuthenticationMode.Default

Profile.IMAPUseSSL = False;
Profile.POP3UseSSL = False;
Profile.SMTPUseSSL = True;

Profile.Password    = "";
Profile.IMAPPassword   = "";
Profile.SMTPPassword   = <SMTP Password>;

Profile.User       = "";
Profile.IMAPUser    = "";
Profile.SMTPUser   = <SMTP User>;

Profile.Timeout = 30;

Profile.IMAPSecureAuthenticationOnly = False;
Profile.POP3SecureAuthenticationOnly = False;
Profile.SMTPSecureAuthenticationOnly = False;

Profile
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)



© 1C LLC. All rights reserved
1C Company respects the privacy of our customers and visitors
to our Web-site.