Android Question Email verification link getting corrupted

james_sgp

Active Member
Licensed User
Longtime User
Hi, I`m doing a user registration in an SQL database through PHP. It works perfectly, but I`m sending a verification link with B4A and the url is getting corrupted for some reason.

http://www.XXXXXXX/XXXXXXX/register2.php?Action=Mail&cardid�9290041B1CED2A6297828077BC7FD9ADDDE05A17BED25D5889F55F658BA14B
http://www.XXXXXXX/XXXXXXX/register2.php?Action=Mail&cardid|31FCF629ED596B4447AE6141772AE1CCB0374EE7A8A6D9FE1AF7C7DB2A9241
http://www.XXXXXXX/XXXXXXX/register2.php?Action=Mail&cardid�6B8C72ABBBECA798070C8CC198C5BAAF7AA012D83B4EA8EDEE3101653A35E2

The = after cardid is getting lost/changed, as I`m losing the first 2 characters of the code. It happens when reading on Outlook on PC, and on Yahoo webmail.

B4X:
Dim my_msg As String
SMTP1.To.Add(XXXXXXXX)
SMTP1.Subject = XXXXXXX
My_msg = .....
my_msg = my_msg & EncDec.AESEncrypt(XXXXXXXX)                   
SMTP1.Body = my_msg
SMTP1.Send

This is one of the strings I`m sending, via SMTP
http://www.XXXXXXX/XXXXXXX/register2.php?Action=Mail&cardid=AA9290041B1CED2A6297828077BC7FD9ADDDE05A17BED25D5889F55F658BA14B
 

james_sgp

Active Member
Licensed User
Longtime User
JohnC

The %EF%BF%BD is actually what the URL is when I do a copy URL from the email... So its replacing the '=DE' in my original URL with that string
 
Upvote 0

james_sgp

Active Member
Licensed User
Longtime User
Going back to basics, and put my message into an HTML editor and it views fine, and the URL is correct...so either B4A is messing with it or the email server is....
 
Upvote 0

JohnC

Expert
Licensed User
Longtime User
Try changing the code to this (adding the 7bit header)
B4X:
Dim M as Map
M.Initialize
M.Put("Content-Type", "text/html; charset=utf-8")
M.Put("Content-Transfer-Encoding", "7bit")
SMTP1.AdditionalHeaders = M
 
Upvote 0

JohnC

Expert
Licensed User
Longtime User
And as a long-shot, try changing the entire url to lower case.
 
Upvote 0

james_sgp

Active Member
Licensed User
Longtime User
JohnC

I FOUND THE SOLUTION!!!
This post in the forum gave me the clue, I added a '3D' after the = and before my security string.

Appreciate your help ?
 
Last edited:
Upvote 0

drgottjr

Expert
Licensed User
Longtime User
sorry i couldn't help. you seem to have things under control now, but i wanted to say that i can get "success" after mailing your html to myself, retrieving it on b4a and clicking on the link to your server. after a number of "parameter errors", you should see a "success" on your server log at about 0340h gmt. that was me.
 
Upvote 0
Top