Hi all,
i have developed a application in asp.net and vb.net, i was sending the mail by HTML format but i want 2 send this in .pdf format with the client images....please can any one help me......
Regards,
S.Inayat Basha.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Hirendra SisodiyaPosted Sep 21, 2009, 1:59 AM
Dim TempMessage As New MailMessage()
TempMessage .From = New MailAddress(txtMailFrom.Text)
TempMessage .[To].Add(New MailAddress(txtMailTo.Text))
TempMessage .Body = txtMessage.Text
TempMessage .IsBodyHtml = True
TempMessage .Subject = txtSubject.Text
If AttachFile.PostedFile IsNot Nothing Then
Dim attFile As HttpPostedFile = AttachFile.PostedFile
Dim attachFileLength As Integer = attFile.ContentLength
If attachFileLength > 0 Then
FileNameToAttache = Path.GetFileName(AttachFile.PostedFile.FileName)
AttachFile.PostedFile.SaveAs(Server.MapPath(FileNameToAttache))
TempMessage .Attachments.Add(New Attachment(Server.MapPath(FileNameToAttache)))
End If
End If
Dim emailWithAttach As New SmtpClient()
emailWithAttach.Host = "localhost"
emailWithAttach.DeliveryMethod = SmtpDeliveryMethod.Network
emailWithAttach.UseDefaultCredentials = True
emailWithAttach.Send(TempMessage )