Rank: Member
Joined: 5/15/2020(UTC) Posts: 2 ![United States United States]()
|
Hi, We’re encountering an error when attempting to send email. The mail server settings appear to be correct, and I’ve tested the SMTP credentials, which are working fine. Is there a way to obtain more detailed error information, either through output or logs? I’ve reviewed the audit logs but haven’t found any mail-related errors. Additionally, I tried temporarily disabling custom error handling, but it seems the error is being caught by the Utilities.MailServices.SendMail method and isn’t being displayed. I also tested sending email from the same application using the following code, and it successfully sent using the same SMTP settings: Code:
var mailMessage = new System.Net.Mail.MailMessage("[email protected]", "[email protected]")
{
Subject = "Test subject",
Body = "Test body"
};
var client = new System.Net.Mail.SmtpClient("smtp.server.com");
client.Credentials = new System.Net.NetworkCredential("username", "password");
client.Send(mailMessage);
Any insights would be greatly appreciated!
|
|
|
|
Rank: Member
Joined: 5/15/2020(UTC) Posts: 2 ![United States United States]()
|
It turns out there was a problem with the certificate on the mail server, so the issue is now resolved.
I would still like to know if there is a way to see errors related to the mail in case a similar issue arises in the future. If anyone is able to provide more info I'd appreciate it.
|
|
|
|
Rank: Member
Joined: 4/29/2010(UTC) Posts: 259
Thanks: 4 times Was thanked: 11 time(s) in 10 post(s)
|
Hi EchoSeven, Looking at your code the only difference I can think of would be the port number? Have you specified a port number within the BV Commerce settings? Quote:I would still like to know if there is a way to see errors related to the mail in case a similar issue arises in the future. If anyone is able to provide more info I'd appreciate it. Currently this is available via Trace for debugging purposes, alternatively you can modify the BVSoftware.Bvc5.Core by adding AuditLog.LogException(Ex) to the SendMail try/catch statement in BVSoftware.Bvc5.Core/Utilities/MailServices.vb Quote: Catch Ex As Exception result = False Trace.Write(Ex.Message) AuditLog.LogException(Ex) End Try
In the next version of BV Commerce, this will be a configurable option so that you can output the error to the audit log.
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.