How to check if the mail has been sent successfully

前端 未结 8 1395
夕颜
夕颜 2020-12-24 07:00

I am developing an Asp.Net application, where I am sending a mail to the user\'s email address, if he forgets the password.

I want to check if the mail has been sent

8条回答
  •  一向
    一向 (楼主)
    2020-12-24 07:31

    According to spec:

    S: 220 smtp.example.com ESMTP Postfix
    C: HELO relay.example.org
    S: 250 Hello relay.example.org, I am glad to meet you
    C: MAIL FROM:
    S: 250 Ok
    C: RCPT TO:
    S: 250 Ok
    C: RCPT TO:
    S: 250 Ok
    C: DATA
    S: 354 End data with .
    C: From: "Bob Example" 
    C: To: Alice Example 
    C: Cc: theboss@example.com
    C: Date: Tue, 15 Jan 2008 16:02:43 -0500
    C: Subject: Test message
    C:
    C: Hello Alice.
    C: This is a test message with 5 header fields and 4 lines in the message body.
    C: Your friend,
    C: Bob
    C: .
    S: 250 Ok: queued as 12345
    C: QUIT
    S: 221 Bye
    {The server closes the connection}
    

    As soon as server says 250 Ok: queued as 12345, you cannot know for sure if it had really sent an email or not, or whether it was delivered.

提交回复
热议问题