Email using Sendgrid

The 1C:Enterprise developers forum

People who like this:0Yes/0No
Just came
Rating: 0
Joined: Jun 13, 2023
Company: Logisoft

Good Morning,

I am having an issue by sending emails from 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>;

Profile = New InternetMailProfile;
Profile.SMTPPassword=<SMTP Password>;
Profile.SMTPAuthentication= smtpauthenticationmode.Default;
Profile.SMTPUser=<SMTP User>;

Mail = New InternetMail;


Do know how to resolve this error?

People who like this:0Yes/0No
Rating: 23
Joined: Oct 3, 2019

Hello Petros,

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

Try the following code:

Profile = New InternetMailProfile;

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

Profile.POP3BeforeSMTP    = False;
Profile.IMAPServerAddress = "";
Profile.POP3ServerAddress = "";
Profile.SMTPServerAddress = "";

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;

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.