Setting SMTP.Body using RAF

PFlores81

Active Member
Licensed User
Longtime User
So far I am able to send the email I need to however, the string inside the raf is not being written to the body of the email. If you've any idea that'd be great. I have figured everything else out that was stopping it from being sent. Now I need the body to contain the text from the raf

B4X:
raf.Initialize(File.DirDefaultExternal, "a12345.dat", False)
     SMTP.Initialize("smtp.gmail.com", 465, "[email protected]", "password", "SMTP")
        SMTP.UseSSL = True 
    SMTP.To.Add (File.ReadString(File.DirDefaultExternal, "Email.txt"))
    SMTP.Subject = "Passcode"
    SMTP.Body = raf.ReadEncryptedObject ("random pass", raf.CurrentPosition)
    SMTP.Body = "Your passcode has been changed to your recovery pw. This Email Is sent from an automated account. Replies will Not be seen. Please Contact the developer should you have any questions."
    SMTP.Send
    raf.Close
 

PFlores81

Active Member
Licensed User
Longtime User
You are setting SMTP.Body twice. The second assignment removes the previous one.
You should use:

B4X:
SMTP.Body = raf.Read... & CRLF & "Your passcode..."

Yeah I figured that was happening, so I went and removed the second SMTP.body and it worked.

Thanks Erel. I appreciate it.
 
Upvote 0

PFlores81

Active Member
Licensed User
Longtime User
Since changing this I am now getting a
java.nio.BufferUnderflowException Only when setting a recovery pass. This was not happening prior to. Not sure what exactly has changed.

Ha, fixed. never mind..
 
Last edited:
Upvote 0
Top