SMTP cripples my attachments

padvou

Active Member
Licensed User
Longtime User
Dear all,
I try to send email with two text files as attachements.
The second is 2,35 kb and comes with garbled characters.
The issue always happens at the same position in the text file and onward. I have attached the file to the thread. The file is created correctly in the android device.
 

Attachments

  • 20121114111918os2.txt
    2.4 KB · Views: 126

padvou

Active Member
Licensed User
Longtime User
Tried to send the two attachements in two different emails.
Even so, the attached file is crippled but later on on the text.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
I've created the following program to test it. The file has arrived successfully.
B4X:
Sub Process_Globals
   'These global variables will be declared once when the application starts.
   'These variables can be accessed from all modules.
   Dim sm As SMTP
End Sub

Sub Globals
End Sub

Sub Activity_Create(FirstTime As Boolean)
   If FirstTime Then
      sm.Initialize("xxx", ... , "sm")
   End If
End Sub

Sub Activity_Resume

End Sub
Sub Activity_Click
   sm.AddAttachment(File.DirAssets, "20121114151502os2.txt")
   sm.Body = "test"
   sm.To.Add("[email protected]")
   sm.Send
End Sub

Sub SM_MessageSent(Success As Boolean)
   Log(Success)
End Sub
 
Upvote 0

padvou

Active Member
Licensed User
Longtime User
The mail server is doing it. Strange that if i send the attached files to a gmail account and then forward them to the original destination which goes through the mail server, the attachements arrive OK. But if I send them directly from the device to the original destination, the attachements are crippled...
Go figure...
So, I think it has nothing to do with the library, so.. case closed.
Thank you!
 
Upvote 0
Top