login about faq

Hi,

I'm trying to send an email with SendGrid to my ticket system Uservoice and get the following error:

220 SG ESMTP service ready at ismtpd0001p1lon1.sendgrid.net
EHLO Trixis-Mac-Pro.fritz.box<CRLF>
250-smtp.sendgrid.net
250-8BITMIME
250-PIPELINING
250-SIZE 31457280
250-AUTH PLAIN LOGIN
250 AUTH=PLAIN LOGIN
AUTH LOGIN<CRLF>
334 VXNlcm5hbWU6
bWFpbEBiZWF0cml4d2lsbGl1cy5kZQ==<CRLF>
334 UGFzc3dvcmQ6
{PasswordOrCredentials}
235 Authentication successful
MAIL FROM:<Beatrix Willius bwillius@gmx.de><CRLF>
RCPT TO:<tickets@mothsoftware.uservoice.com><CRLF>
DATA<CRLF>
501 Sender syntax error
503 Must have sender before recipient
503 Must have valid receiver and originator
RSET<CRLF>
250 I remember nothing

The code is

  'set up the chilkat version of the socket
  Dim mailman As New Chilkat.MailMan
  Dim success As Boolean = mailman.UnlockComponent("test")
  If (success <> True) Then
    Return
  End If

  'do the smtp details
  mailman.SmtpHost = "smtp.sendgrid.net"
  mailman.SmtpUsername = "username"
  mailman.SmtpPassword = "password"
  mailman.SmtpSsl = True
  mailman.SmtpPort = 465

  // populate the email message to company
  Dim MailToCompany As New Chilkat.Email
  MailToCompany.fromAddress = "<test>"
  MailToCompany.subject = "Error Report"
  call MailToCompany.AddTo("", "tickets @ mothsoftwarexxxuservoicexxxcom")

  success = mailman.SendEmail(MailToCompany)
  If (success <> True) Then
    System.DebugLog(mailman.LastErrorText)
    Return
  End If

  success = mailman.CloseSmtpConnection()
  If (success <> True) Then
    System.DebugLog("Connection to SMTP server not closed cleanly.")
  End If

The problem seems to be specific to SendGrid because I found a couple of mentions at https://github.com/bcit-ci/CodeIgniter/issues/2289 or http://stackoverflow.com/questions/39901300/smtp-mail-server-sendgrid-error-on-submission/39902008. But I don't know how this applies to my code.

Xojo 2016r3, MacOS 10.11, Chilkat plugin from June 2016

Mit freundlichen Grüßen/Regards

Beatrix Willius

http://www.mothsoftware.com Mail Archiver X: The email archiving solution for professionals

asked Nov 15 '16 at 08:31

bwill's gravatar image

bwill
3513

edited Nov 16 '16 at 13:21

chilkat's gravatar image

chilkat ♦♦
12.8k318385539


Hi Beatrix,

The address passed to the "MAIL FROM" command in the SMTP session should only include the email address (not the friendly name)

This is incorrect:

MAIL FROM:<Beatrix Willius bwillius@gmx.de><CRLF>

This is correct:

MAIL FROM:<bwillius@gmx.de><CRLF>

I suspect the issue is that the email object's FromAddress was set to the string "Beatrix Willius bwillius@gmx.de" Make sure the FromAddress is set to "bwillius@gmx.de", and the FromName is set to "Beatrix Willius". An alternative is to set the From property equal to the entire string: "Beatrix Willius bwillius@gmx.de"

See this example: http://www.example-code.com/xojo/email_from.asp

link

answered Nov 16 '16 at 13:36

chilkat's gravatar image

chilkat ♦♦
12.8k318385539

Thanks! Changing the FromAddress solved the problem.

Mit freundlichen Grüßen/Regards

Beatrix Willius

http://www.mothsoftware.com Mail Archiver X: The email archiving solution for professionals

link

answered Nov 17 '16 at 03:12

bwill's gravatar image

bwill
3513

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×89
×23

Asked: Nov 15 '16 at 08:31

Seen: 1,144 times

Last updated: Nov 17 '16 at 03:12

powered by OSQA