Mail Attachment problem

T

tma

I am exporting a Crystal report to a .pdf. My problem is that when I attach the file to a message with the below code, the file attachment is truncated and will not open. As an aside, I'm using Mercury/32 as a mail server. I have not tested this using XP Pro mail services.

Any help is greatly appreciated.


Dim mailMsg As New MailMessage
With mailMsg

..From = "(e-mail address removed)"

..To = oApplicant.Email

..Bcc = "(e-mail address removed)"

..Subject = "Your Application"

..BodyFormat = MailFormat.Html

'Dim mailAttachment As MailAttachment

If Not Session("Fname") Is Nothing Then

Dim Fname As String = Session("Fname")

..Attachments.Add(New MailAttachment(Fname))

End If

End With

SmtpMail.SmtpServer = "127.0.0.1"

SmtpMail.Send(mailMsg)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top