Hello
I really need some help with an email problem I am having.
Some background on the App:
It downloads data via Bluetooth and saves it to a text file in the root of the external storage.
Once the download is complete you have the option to send an email with this text file attached.
The App creates and attaches the correct file and I can then send it from my chosen email client.
The App is designed to overwrite the same file every time data is downloaded by Bluetooth.
The Problem:
If I download for a second time and click SEND the email that is created contains the attachment twice.
My code is below:
Sub btnSend_Click
'-------------------------------------------------------
' SEND EMAIL
'-------------------------------------------------------
If MyDownloaded=True Then ' If data downloaded
Message.To.Add(Main.MyEmail) ' Set email
Message.Subject ="Application Data" ' Set subject
Message.Attachments.Add(File.Combine(File.DirRootExternal, MyFile))
StartActivity(Message.GetIntent) ' Send mail
Activity.finish
End If
End Sub
I’m lost on how to fix this and any help would be appreciated.
Regards,
Lorna