Internal : Could not execute code stage because exception thrown by code stage:The remote certificate is invalid according to the validation procedure

Lavanya

New Member
Hi Everyone,
I have used Email - POP3/SMTP VBO to send attached files by passing data items with values. When I run this process aim getting below error at Email-POP3/SMTP VBO "Send Message" Action. Any help will be appreciated.

"Internal : Could not execute code stage because exception thrown by code stage: The remote certificate is invalid according to the validation procedure."
 

Attachments

  • 1526490135300.png
    1526490135300.png
    93.2 KB · Views: 116
Last edited:

sreejith

Member
Hi @sreekanth

Telnet to the gateway and try to send test mail. If it doesn't work then its mail server issue. If it works and still unable to send mail then try using the below code for sending the mail

SmtpClient client = new SmtpClient();
client.Port = (int)Port;
client.Host = HostServer;
client.EnableSsl = false;
client.Timeout = 10000;
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.UseDefaultCredentials = true;
client.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;
MailMessage mm = new MailMessage(From, To, Subject, Body);
foreach(DataRow dr in Attachments.Rows)
{
string file = dr["FileName"].ToString();
Attachment data = new Attachment(file, MediaTypeNames.Application.Octet);
ContentDisposition dis = data.ContentDisposition;
dis.CreationDate = File.GetCreationTime(file);
dis.ModificationDate = File.GetLastWriteTime(file);
dis.ReadDate = File.GetLastAccessTime(file);
mm.Attachments.Add(data);
}
mm.BodyEncoding = UTF8Encoding.UTF8;
mm.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure;
client.Send(mm);
 

Deepak Soni

New Member
Hello Everyone,
Am getting this error, while sending an Email along with attachment. can someone help me in resolving this.

Internal : Could not execute code stage because exception thrown by code stage: The remote certificate is invalid according to the validation procedure.
 

Attachments

  • Capture.JPG
    Capture.JPG
    34.8 KB · Views: 7
  • Capture1.JPG
    Capture1.JPG
    20.3 KB · Views: 8
Top