Send an email with Jmail

xiaoxiao2021-03-06  103

Function SendMail (ByVal From As String, _ ByVal Recipient As String, _ ByVal RecipientCC As String, _ ByVal RecipientBCC As String, _ ByVal Subject As String, _ ByVal Body As String, _ ByVal Attachment As String, _ ByVal Priority As Integer, _BYVAL MailServer AS String, _ Byval MailServerUsername As String, _ Byval MailServerPassword As String) AS Boolean

'From send address' Recipient Receive Add Address' RecipientCC Copy Cc Cc Copy' RecipientBCC Hidden Copy Cc 'Subject Email Title' BODY Mail Content 'Attachment Accessories' Priority Message Priority, from 1 to 5' MailServer SMTP server IP address or Name 'MailServeruserName SMTP Server Username' MailServerPassword SMTP Server Password DIM Email As New Jmail.Message with email .logging = true 'calls log record for DEBUG.silent = TRUE

.MailServerUserName = MailServerUserName 'SMTP server user name .MailServerPassWord = MailServerPassWord' SMTP server password .From = From 'send address .AddRecipient (Recipient)' receives the address .AddRecipientBCC (RecipientBCC) 'hidden copy to .AddRecipientCC (RecipientCC)' copy Cc. Subject = Subject 'mail title. Body = body' mail content if len (attachment)> 0 "Attachment (attachment) 'Attachment .Priority = priorityif email.send (mailserver) TEND (MailServer) TENDMAIL = TRUE Else sendmail = false endiff = nothing 'Destruction instance end function

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

New Post(0)