Direct Mail Delivery

Source: Internet
Author: User
Qq enterprise mailbox and Gmail enterprise mailbox were used for testing

Qq enterprise email:
If you use the account admin@company.com to configure smtpclient, if from is a info@company.com, it cannot pass verification, QQ disables this

Gmail enterprise mailbox:
If you use the account admin@company.com to configure smptclient, if from is a info@company.com, you can pass verification, but the received mail from is a admin@company.com instead of a info@company.com

Therefore, direct delivery is selected and verification is avoided.

Direct delivery poses several problems. Currently, the mail service is sensitive to spam, so the restrictions are high. (But I don't want to send spam, just test it .)
Dynamic IP direct delivery test

Gmail test, allow
Qq test, allow

Hotmail test, not allowed

Message: DY-001 mail rejected by Windows Live Hotmail for policy reasons. we generally do not accept email from dynamic IP's as they are not typically used to deliver unauthenticated SMTP e-mail to an Internet mail server. http://www.spamhaus.org maintains lists of dynamic and residential IP addresses. if you are not an email/network admin please contact your e-mail/Internet service provider for help. email/network admins, please visit http://postmaster.live.com for Email Delivery Information and Support

Other mailboxes are not tested.
During direct delivery during development, we found that Gmail support is too good, but it may not be a good thing, because Gmail normally shows that Hotmail is sometimes a chip, while QQ simply does not. So we need to test several more mailboxes.

-----------------------------------------------------------------------
General idea of direct delivery in development
Send from from@gmail.com to to@qq.com

1. Obtain the local DNS address. If the local DNS address does not exist, use open DNS: 208.67.222.222.

2. Find the SMTP server address of
2.1 to@qq.com domain name for QQ.com

2.2 Use the above DNS address to find the MX records of QQ.com (sorted by priority) (you can use DNS to find open source class libraries)
Returns mx1.qq.com, mx2.qq.com...
2.3 find the IP addresses of mx1.qq.com and mx2.qq.com. This is the SMTP server address we need.
You can use system. net. DNS. gethostentry ("mx1.qq.com") to obtain the IP address.

3. Use SOCKET to extract a connection address from the above SMTP server address for communication.
Ipendpoint endpoint = new ipendpoint (address, 25 );
Socket socket = new socket (endpoint. addressfamily, sockettype. Stream, protocoltype. TCP );
Socket. Connect (endpoint );

If (socket. Connected) {}// if connected is true, communication is allowed.

4. The first three digits of the received socket data are status codes, followed by prompts, and check status codes = smtpstatuscode. serviceready
Preparations are complete.

5. Send the data helo myhostname (handshake)
5.1. Check status code = smtpstatuscode. OK

6. Send data mail from: <from@gmail.com>
6.1. Check status code = smtpstatuscode. OK

7. Send data rcpt to: <to@qq.com> (this command also applies to CC)
7.1. Check status code = smtpstatuscode. OK

8. Send data
8.1. Check status code = smtpstatuscode. startmailinput (start to input data)

9. Send Email Subject
9.1. Check status code = smtpstatuscode. OK

10. Send data quit (Exit)
10.1. Check status code = smtpstatuscode. serviceclosingtransmissionchannel

To send an email subject, you must use the original email format. you can install an email client to view the subject.
The mime Message format is involved. For details, see http://wenku.baidu.com/view/d59ab3e9856a561252d36fb8.html.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.