Public Shared Sub SendMailMessage(ByVal ParaFrom As String, ByVal ParaRecepient As String, ByVal ParaBcc As String, ByVal ParaCc As String, ByVal ParaSubject As String, ByVal ParaBody As String, ByVal ParaAttachment As String) Dim mMailMessage As New MailMessage() mMailMessage.From = New MailAddress(ParaFrom) mMailMessage.To.Add(New MailAddress(ParaRecepient)) If Not ParaBcc Is Nothing And ParaBcc <> String.Empty Then mMailMessage.Bcc.Add(New MailAddress(ParaBcc)) End If If Not ParaCc Is Nothing And ParaCc <> String.Empty Then mMailMessage.CC.Add(New MailAddress(ParaCc)) End If mMailMessage.Subject = ParaSubject mMailMessage.Body = ParaBody mMailMessage.IsBodyHtml = True mMailMessage.Priority = MailPriority.Normal Dim mSmtpClient As New SmtpClient("delphitech.com.hk") mSmtpClient.Credentials = New NetworkCredential("Jack", "password") mMailMessage.Attachments.Add(New Attachment(ParaAttachment)) mSmtpClient.Send(mMailMessage) MsgBox("发送成功") End Sub 引用 SendMailMessage("Jack.lin@d****.com.hk", "j*****@163.com", "", "", "mail send test", "新测试001", gRptPath & GL("@DSL1610") & ".PDF")