HI all,
I use this piece of code to attach a binary file to a mail for which I want the user to be able to choose the mail App. Thus I use an intent.
The behavior is quite good but :
1) a few mail app do not allow to send .exe files ... this is the case of my Nexus5 stock mail App
2) Other App allow to send .exe files (eg K9-Mail or Google drive) but the mail when received on a PC contains a .txt file...
To be clear I can save the attachment on my hard drive but I have to rename the extension from .exe.txt to .exe
Even worse with google drive the file is saved with "name.txt". And I have to know that it is a .exe extension.
The same file sent directly with the same mail App is properly attached and received with the good extension ".exe"
Do you have any idea why the attachment is forced to .txt ?
Thanks
I use this piece of code to attach a binary file to a mail for which I want the user to be able to choose the mail App. Thus I use an intent.
B4X:
Sub PC_click
Try
Dim EMailAddrTo, Subject, Body As String
'EMailAddrTo = "MyFriend@gmail.com"
Subject = "PowerPoint Mouse PC server executable"
Body = "Please find attached the PC server executable file" & CRLF & "Save the file and launch it." & CRLF & CRLF & "Then launch the Android App to automatically connect."
Dim message As Email
message.To.Add(EMailAddrTo)
message.Subject = Subject
message.Body = Body
message.Attachments.Initialize
message.Attachments.Add(File.Combine(PowerPointMouseDir, "PowerPointMouse PCserver.exe"))
StartActivity(message.GetIntent)
Catch
ToastMessageShow("Unable to send mail...", False)
End Try
End Sub
The behavior is quite good but :
1) a few mail app do not allow to send .exe files ... this is the case of my Nexus5 stock mail App
2) Other App allow to send .exe files (eg K9-Mail or Google drive) but the mail when received on a PC contains a .txt file...
To be clear I can save the attachment on my hard drive but I have to rename the extension from .exe.txt to .exe
Even worse with google drive the file is saved with "name.txt". And I have to know that it is a .exe extension.
The same file sent directly with the same mail App is properly attached and received with the good extension ".exe"
Do you have any idea why the attachment is forced to .txt ?
Thanks