Super weird problem with sending emails

I’m sending emails with the Chilkat plugins and SendGrid to my ticket system. SendGrid is changing security and therefore I have to update username and password.

My app comes in different flavours. The email sending code works fine for 2 versions and fails for the third. The code is identical. I’m at a loss how to debug the problem.

Here is the relevant section from the verbose log of the Chilkat plugin:

                      <info>Single-threaded domain to IP address resolution</info>
                      <info>connecting to IPV4 address...</info>
                      <ipAddress>159.122.219.43</ipAddress>
                      <createSocket ms="1">
                        <info>Setting SO_SNDBUF size</info>
                        <sendBufSize>262144</sendBufSize>
                        <info>Setting SO_RCVBUF size</info>
                        <recvBufSize>4194304</recvBufSize>
                      </createSocket>
                      <connect>
                        <socketErrno>64</socketErrno>
                        <socketError>Host is down</socketError>
                      </connect>
                    </connect_ipv6_or_ipv4>
                    <connect_ipv6_or_ipv4>
                      <info>Single-threaded domain to IP address resolution</info>
                      <info>connecting to IPV4 address...</info>
                      <ipAddress>159.122.219.43</ipAddress>
                      <createSocket>
                        <info>Setting SO_SNDBUF size</info>
                        <sendBufSize>262144</sendBufSize>
                        <info>Setting SO_RCVBUF size</info>
                        <recvBufSize>4194304</recvBufSize>
                      </createSocket>
                      <connect>
                        <socketErrno>64</socketErrno>
                        <socketError>Host is down</socketError>
                      </connect>

I’m quite sure that the host is not down. I’ve now switched a couple of times between the versions. And every time I can send an email with one version of the app and not the other.

Does anyone have an idea why I have such a weird problem?

Some code:

'do the smtp details
mailman.SmtpHost = "smtp.sendgrid.net"
mailman.SmtpUsername = app.GetMore
mailman.SmtpPassword = app.GetSocket
mailman.SmtpSsl = True
mailman.SmtpPort = 465
Mailman.ConnectTimeout = 60
Mailman.ReadTimeout = 60

// populate the email message to company
Dim MailToCompany As New Chilkat.Email
MailToCompany.fromAddress = "<"+ TFEmailAddressText.Trim + ">"
MailToCompany.subject = "Error Report"

// add recipients
dim CompanyEmail as String = app.GetOther
call MailToCompany.AddTo("tickets", CompanyEmail)

'do the mail text
MailToCompany.SetTextBody("Name: " + TFNameText.Trim + EndOfLine + "Email: " + TFEmailAddressText.Trim + EndOfLine + EndOfLine + EndOfLine + "Description of Error: " + EndOfLine + TAMessageText + EndOfLine + EndOfLine, "text/plain")

CkoMailTask = mailman.SendEmailAsync(MailToCompany)

Is this problem only on one machine or for all users?
Have you accidentally blocked the app with something like littlesnitch?

So far I haven’t released the new app versions. I’ll check with Little Snitch.

I’ve been having problems with SendGrid also, and have a request into them for help. Fortunately, they have relaxed the deadline for switching until January (according to a message I received from them).

I just shot myself in the foot with Little Snitch. Of course, I deployed a new version of my app before the extension.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.