problem with email attachments (in xojo example files)

[quote=377636:@Alberto De Poo]Are you using Gmail smtp server or other server?
What server is marking your emails as spam, the smtp server or the receiving server? If it is the receiving server is one in particular, like Gmail, Hotmail, company server, or all of them?[/quote]
I use the french provider “free”, it is my provider smtp server that’s blocking the mails I send.

You could try to add HTML part, but if your provider is blocking you maybe they have now a filter for your email (at least if the headers are the same as before, that’s why there are no issues with apple Mail).

Do you have a X-mailer defined? You can try to remove that or change it.

If I were you I’ll look for other smtp provider.

See for instance here: . So no, changing the provider will not solve the problem.

Sorry, for provider I was thinking about SendGrid, Mandril or similar.

For me is weird that only sending 30 emails his provider will block them. I don’t consider sending 30 or 100 emails a day ‘bulk mail’. Even the information on that link say 250 recipients at any given time (not defining time).

[quote=377636:@Alberto De Poo]Are you using this from the demo?:

mail.Headers.AppendHeader(“X-Mailer”,“Xojo SMTP Demo”)[/quote]
I’m using

mail.Headers.AppendHeader("X-Mailer","My Xojo Name App")

As far as I understand Jean-Yves is using is own ISP where the link I gave applies. For Mandril, SendGrid etc. this does NOT apply.

I would really appreciate ! thanks.

I ended up with this code, it’s been a while so I can’t tell why I did this, or that though :slight_smile:

mail.Headers.AppendHeader("MIME-version", "1.0") mail.Headers.AppendHeader("Content-type", "multipart/alternative; charset=UTF-8") mail.Subject = "=?UTF-8?B?" + EncodeBase64(DefineEncoding(emailSubject, Encodings.UTF8)) + "?=" mail.BodyHTML = DefineEncoding(emailContent_HTML, Encodings.UTF8) mail.BodyPlainText = DefineEncoding(emailContent_TEXT, Encodings.UTF8) mail.fromAddress = "=?UTF-8?B?" + EncodeBase64(DefineEncoding(smtpFrom, Encodings.UTF8)) + "?=" + "<" + smtpSender + ">"
All the ?UTF-8?B? was to make sure the encoding worked on all readers, it seems it did :slight_smile:

I’m also attaching images using this:

file.LoadFromFile(GetFolderItem(Attachments.Name(x), FolderItem.PathTypeShell))
fileExtension = NthField(file.Name, ".", 2)
file.MIMEType = "image/jpeg"
file.ContentEncoding = "base64"
file.Name = "=?UTF-8?B?" + EncodeBase64(DefineEncoding(Attachments.Value(Attachments.Name(x)) + "." + fileExtension, Encodings.UTF8)) + "?="

you did not use a X-Mailer header ?

Nope, I did not :slight_smile:

Also, it’s using MailJet as SMTP.

so the problem was that I did not send any HTML in the mail. sending RTF part is useless ans smtp server block it.
I removed the bodyenriched, added the bodyHTML, and the message was accepted.
thanks for the helps

now I have to figure how to transform RTF to HTML the most better looking way possible…