I’m trying to use the sample code from Examples to send an email with attachment , the problem is that even if I set It as PDF and send it properly when I receive the mail from the app instead of the file with the name I get an attachment called Mail attachment.pdf and when I try to open it it says that it cannot be opened and it appears to be corrupt , any idea on this ? and there is a way to actually keep the name and the integrity of it ?
Sample code you find it in Examples folder and what I added extra was the MIME and added the line in the code :
[quote]// add attachments
If fileFld.Text <> “” Then
file = New EmailAttachment
file.LoadFromFile(GetFolderItem(fileFld.Text)) file.MIMEType = FileTypes.Pdf
mail.Attachments.Append(file)
End If
[/quote]
Thanks a lot Sean, it seems that the trick did the job and it is not broken after all.
So for everybody to use it in case needed.
In the examples in the Send Button you have the following code :
// add attachments
If fileFld.Text <> "" Then
file = New EmailAttachment
file.LoadFromFile(GetFolderItem(fileFld.Text))
mail.Attachments.Append(file)
End If
Replace it By
// add attachments
If fileFld.Text <> "" Then
file = New EmailAttachment
file.LoadFromFile(GetFolderItem(fileFld.Text, 3))
mail.Attachments.Append(file)
End If
[quote]file.LoadFromFile(GetFolderItem(fileFld.Text, 3))[/quote] which sets the path as native path.