Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

c# mailversand: anhang nicht rfc-conform?!

Empfohlene Antworten

Hallo zusammen,

hab in c# ein kleines progrämchen geschrieben, welches mit Hilfe des System.Web.Mail Emails versendet. Leider kommen die Mails mit Anhang nicht an. Es wird vom Empfänger Mailserver gemäckert, dass diese nicht rfc-conform seien. An was kann es liegen?

				

MailMessage myMail = new MailMessage();



myMail.From = sFrom.ToString();

myMail.To = sTo.ToString();

myMail.Subject = sSubject.ToString();

myMail.Body = sBody.ToString();


myMail.BodyFormat = mFormat;


if (sAtachment != string.Empty)

myMail.Attachments.Add(new MailAttachment(@sAtachment));


SmtpMail.SmtpServer = sSmtpServer;


SmtpMail.Send(myMail);

Danke

Ciao

Antibiotik

Es wird vom Empfänger Mailserver gemäckert, dass diese nicht rfc-conform seien.

was sagt denn der SMTP konkret - die numerische fehlernummer wäre interssant.

myMail.BodyFormat = mFormat;

und was hast du als mFormat definiert (MailFormat.Html, MailFormat.Text oder garnix)?

s'Amstel

hallo,

was sagt denn der SMTP konkret - die numerische fehlernummer wäre interssant.

Unser SMTP spuckt folgendes raus:

"Bad Data Recognize SMTP Messages. The Content-Transfer-Encoding header value '7bit filename=anhang.zip is invalid"

Fehlernummer hab ich leider keine.

und was hast du als mFormat definiert (MailFormat.Html, MailFormat.Text oder garnix)?

s'Amstel

MailFormat.Text

Danke

Ciao

Antibiotik

The Content-Transfer-Encoding header value '7bit filename=anhang.zip is invalid"

das ist dann vielleicht ein bug - jedenfalls wüsste ich nicht, was filename in diesem header zu suchen hätte; versuch mal, folgende zeile reinzunehmen (ungetestet):

myMail.Headers.Add("Content-Transfer-Encoding","base64");
oder deinem attachment selbst ein neues encoding zu setzen (wobei ich glaube, dass base64 ohnehin default ist).
myMail.MailAttachment.Encoding = Base64;

s'Amstel

Danke,

du hast mich auf den richtigen Weg gebracht. ;-)

Muss MailEncoding.UUEncode beim Attachment angeben.

Danke nochmal

Ciao

Antibiotik

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.