Imports System.Web.Mail Imports System.IO Imports System.IO.Directory function snd_mail() Dim bdm As String '/////////////////////////////// READ */* HTML */* Dim objStreamReader As StreamReader = File.OpenText(Server.MapPath("~\smp\index.html")) bdm = objStreamReader.ReadToEnd() objStreamReader.Close() '////////////////////////// END READ */* HTML */* bdm = Replace(bdm, "src='", "src='cid:") Dim MyMail As MailMessage = New MailMessage() MyMail.From = "xxx" MyMail.To = "xxx" MyMail.Subject = "xxx" MyMail.Body = bdm For i = 1 To 53 Dim ii As String If i < 10 Then ii = "0" & i Else ii = i End If Dim attachment As New MailAttachment(Server.MapPath("~\smp\image_" & ii & ".jpg")) MyMail.Attachments.Add(attachment) Next MyMail.BodyEncoding = Encoding.UTF8 MyMail.BodyFormat = MailFormat.Html MyMail.Priority = MailPriority.High MyMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1") 'basic authentication MyMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "xxx") 'set your username here MyMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "xxx") 'set your password here SmtpMail.SmtpServer = "xxx" 'your real server goes here SmtpMail.Send(MyMail) end function
Imports System.Net.Mail Imports System.Net.Mime
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)