QQ聊天

MaxScript通过.net发送邮件

 

Fn SmtpSendMail argSmtpAddress argSenderAddress  argSenderPassword argTargetAddress argTitle argMessage = 
(
    tempSmtpClient = DotNetObject "System.Net.Mail.SmtpClient" argSmtpAddress
    tempSmtpClient.UseDefaultCredentials = false

    tempSmtpClient.Credentials = DotNetObject "System.Net.NetworkCredential" argSenderAddress argSenderPassword
    tempSmtpClient.DeliveryMethod = (DotNetClass "System.Net.Mail.SmtpDeliveryMethod").Network

    senderAddress = DotNetObject "System.Net.Mail.MailAddress" argSenderAddress
    targetAddress = DotNetObject "System.Net.Mail.MailAddress" argTargetAddress

    tempMail = DotNetObject "System.Net.Mail.MailMessage"  senderAddress targetAddress
    tempMail.Sender = senderAddress
    tempMail.IsBodyHtml = false
    tempMail.BodyEncoding = (dotnetClass "System.Text.Encoding").UTF8
    tempMail.SubjectEncoding = (dotnetClass "System.Text.Encoding").UTF8
    tempMail.Subject = argTitle
    tempMail.Body = argMessage

    tempSmtpClient.Send tempMail
)

 

 

 

posted @ 2013-07-24 11:57  SITT  阅读(939)  评论(0编辑  收藏  举报
QQ聊天