2004.11.5 Send mail with System.Web.mail

xiaoxiao2021-03-06  99

The mother will go back to the hometown tomorrow, I wish I I have a good trip! One code seen on the blog of others. Heads: http://blog.joycode.com/ghj/archive/2004/02/17/13197.ASPX The following code needs to reference system.web.dllprivate void Page_Load (Object Sender, System.EventArgs E) before use. MailMessage Mail = New MailMessage (); mail.to = "me@mycompany.com"; mail.from = "You@yourcompany.com"; mail.subject = "this is a test email."; Mail.body = " Some text goes here "; mail.fields.add (" http://schemas.microsoft.com/cdpo/configuration/smtpauthenticate, "1"); // Basic Authentication mail.fields.add ("http: ///////// schemas.microsoft.com/cdo/configuration/sendusername "," my_username_here "); // set your username here mail.Fields.Add (" http://schemas.microsoft.com/cdo/configuration/sendpassword "," super_secret "); // set your password here smtpmail.smtpserver =" mail.mycompany.com "; // Your real server goes here smtpmail.send (mail);} The mother is already back, happy!

转载请注明原文地址:https://www.9cbs.com/read-95978.html

New Post(0)