| |

VerySource

 Forgot password?
 Register
Search
View: 706|Reply: 3

C # implementation of the problem of sending email, please master

[Copy link]

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-3-3 23:00:01
| Show all posts |Read mode
Use the System.Web.Mail class library
MailMessage Message = new MailMessage ();
'Set mail receipt properties
Message.Headers.Add ("Disposition-Notification-To", MailFrom);


The email is sent successfully, and the receipt can also be received, but why is there a text-type attachment in the receipt of the receipt?
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-9-2 16:45:01
| Show all posts
Tried it, it is true. . Bang top down.
Reply

Use magic Report

0

Threads

2

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 Australia

Post time: 2020-9-2 17:00:01
| Show all posts
I'm afraid this can't be controlled, it should involve the interpretation of the protocol by the net base class.

The following is an example in RFC3249, the part marked in red should be similar to the text attachment you see.

Date: 14 Dec 1999 17:48:44 +0900
      From: ken_recipient@example.com
      Message-ID: <19991214174844.98765@example.com>
      Subject: Your message was processed successfully. (MDN)
      To: mary@example.net
      Mime-Version: 1.0
      Content-Type: multipart/report;
        report-type=disposition-notification; boundary="61FD1001_IFAX"

[color=#FF0000] --61FD1001_IFAX
      Content-Type: text/plain

      This is a Return Receipt for the mail that you sent to
      "ken_recipient@example.com". The message and attached files may
      have been printed, faxed or saved. This is no guarantee that the
      message has been read or understood.[/color]
      --61FD1001_IFAX
      Content-Type: message/disposition-notification

      Reporting-UA: ken-ifax.example.com; barmail 1999.10
      Original-Recipient: rfc822;ken_recipient@example.com
      Final-Recipient: rfc822;ken_recipient@example.com
      Original-Message-ID: <19991214174010O.mary@example.net>
      Disposition: automatic-action/MDN-sent-automatically; dispatched

      --61FD1001_IFAX--
Reply

Use magic Report

0

Threads

2

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 Australia

Post time: 2020-9-2 17:15:01
| Show all posts
[Quote=Quote the reply fromcirclemanon the 4th floor:]
I'm afraid this can't be controlled, it should involve the interpretation of the protocol by the net base class.

The following is an example in RFC3249, the part marked in red should be similar to the text attachment you see.

Date: 14 Dec 1999 17:48:44 +0900
From: ken_recipient@example.com
Message-ID: <19991214174844.98765@example.com>
_
[/Quote]

It seems that the explanation is wrong, not the explanation of the protocol by the net base class. It's the implementation of the other party's mail server. You can't modify this, and your different mail server implementations may be different. Some servers may not support it.
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list