简体   繁体   中英

Send Email without SMTP protocol

VB can be used to send emails that can be viewed in any email client as shown below (no client specified)

Set objMessage = CreateObject("CDO.Message") 
objMessage.Subject = "Example CDO Message" 
objMessage.From = "me@my.com" 
objMessage.To = "test@paulsadowski.com" 
objMessage.TextBody = "This is some sample message text." 
objMessage.Send

Can c# send emails without specifying the smtp client?

VB uses a local SMTP Server on your machine. See here for details.

To do the same in C# have a look at this question: convert vb email send code to c#

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM