L laguilar Member Licensed User Longtime User Dec 16, 2012 #1 hey guys maybe you can help me out with this. im trying to send en email upon registration of our application. here is my code below. it successfully goes through the send function and it logs with a failure due to a NumberFormatException. any ideas? the domain is temporarily for private use until we go live so the real domain has been replaced with MYDOMAIN.com for sake of this post. The mail server im using is MailEnable Mail Server running on a dedicated windows web host. the address [email protected] exists and the password is correct. I've tried 2 variations of the username one with the @MYDOMAIN.com and one without with the same result. port is correct. it uses ssl. I've verified the connectivity with another mail client. Code: Copy report.Initialize("mail.MYDOMAIN.com", 587, "[email protected]", "password", "report") report.UseSSL = True report.To.Add("[email protected]") report.Sender = "[email protected]" report.Subject = "Android Registration" report.Body = "--Android Registration--" & CRLF report.Body = report.Body & "--Company Information--" & CRLF For i = 0 To comprow.Size - 1 report.Body = report.Body & comprow.GetKeyAt(i) & ":" & comprow.GetValueAt(i) Next report.Send Code: Copy Sub report_MessageSent(Success As Boolean) Log(Success) If Success Then ToastMessageShow("Message sent successfully", True) Else ToastMessageShow("Error sending message", True) Log(LastException.Message) End If End Sub Code: Copy ** Activity (main) Create, isFirst = True ** ** Activity (main) Resume ** false java.lang.NumberFormatException: Invalid double: "null"
hey guys maybe you can help me out with this. im trying to send en email upon registration of our application. here is my code below. it successfully goes through the send function and it logs with a failure due to a NumberFormatException. any ideas? the domain is temporarily for private use until we go live so the real domain has been replaced with MYDOMAIN.com for sake of this post. The mail server im using is MailEnable Mail Server running on a dedicated windows web host. the address [email protected] exists and the password is correct. I've tried 2 variations of the username one with the @MYDOMAIN.com and one without with the same result. port is correct. it uses ssl. I've verified the connectivity with another mail client. Code: Copy report.Initialize("mail.MYDOMAIN.com", 587, "[email protected]", "password", "report") report.UseSSL = True report.To.Add("[email protected]") report.Sender = "[email protected]" report.Subject = "Android Registration" report.Body = "--Android Registration--" & CRLF report.Body = report.Body & "--Company Information--" & CRLF For i = 0 To comprow.Size - 1 report.Body = report.Body & comprow.GetKeyAt(i) & ":" & comprow.GetValueAt(i) Next report.Send Code: Copy Sub report_MessageSent(Success As Boolean) Log(Success) If Success Then ToastMessageShow("Message sent successfully", True) Else ToastMessageShow("Error sending message", True) Log(LastException.Message) End If End Sub Code: Copy ** Activity (main) Create, isFirst = True ** ** Activity (main) Resume ** false java.lang.NumberFormatException: Invalid double: "null"
Erel B4X founder Staff member Licensed User Longtime User Dec 17, 2012 #2 Please check the unfiltered logs. The full error should be logged there.
L laguilar Member Licensed User Longtime User Dec 17, 2012 #3 detailed logcat here is the details below. it says You must specify the recipients of a message before you can send it. clearly I set the recipient. Code: Copy java.lang.RuntimeException: Empty writer returned: 503 Bad sequence of commands. You must specify the recipients of a message before you can send it at anywheresoftware.b4a.net.SMTPWrapper$1.run(SMTPWrapper.java:248)at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:442) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305) at java.util.concurrent.FutureTask.run(FutureTask.java:137) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569) at java.lang.Thread.run(Thread.java:856)
detailed logcat here is the details below. it says You must specify the recipients of a message before you can send it. clearly I set the recipient. Code: Copy java.lang.RuntimeException: Empty writer returned: 503 Bad sequence of commands. You must specify the recipients of a message before you can send it at anywheresoftware.b4a.net.SMTPWrapper$1.run(SMTPWrapper.java:248)at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:442) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305) at java.util.concurrent.FutureTask.run(FutureTask.java:137) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569) at java.lang.Thread.run(Thread.java:856)
M melamoud Active Member Licensed User Longtime User Dec 17, 2012 #4 something to try you should try sending using gmail , just to see if the problem is competability with your mail server or not (gmail should work) I had similar case / error but I was using by mistake an SMTP object twice, (I called send twice, the problem is that the send method clean the SMTP object and thats why I got the error that I do not have recepiants configured. are you sure you are not doing that (calling send somewhere else in the code) if you do that maybe the error for this line is something else like no rout to host or something like that and the error for the other send is what you see right now (SMTP object is wiped clean) - I know its not likely but worth noting....
something to try you should try sending using gmail , just to see if the problem is competability with your mail server or not (gmail should work) I had similar case / error but I was using by mistake an SMTP object twice, (I called send twice, the problem is that the send method clean the SMTP object and thats why I got the error that I do not have recepiants configured. are you sure you are not doing that (calling send somewhere else in the code) if you do that maybe the error for this line is something else like no rout to host or something like that and the error for the other send is what you see right now (SMTP object is wiped clean) - I know its not likely but worth noting....
L laguilar Member Licensed User Longtime User Dec 18, 2012 #5 gmail works thats confirmed. gmail worked. I created a test account at gmail and it worked.
M melamoud Active Member Licensed User Longtime User Dec 18, 2012 #6 SO I guess the problem is competability of thje net lib implmentation of SMTP with the mail server you are using right ? do you own that mail server ? can you turn off SSL to check if the problem is the SSL competability ?
SO I guess the problem is competability of thje net lib implmentation of SMTP with the mail server you are using right ? do you own that mail server ? can you turn off SSL to check if the problem is the SSL competability ?
L laguilar Member Licensed User Longtime User Dec 20, 2012 #7 melamoud said: SO I guess the problem is competability of thje net lib implmentation of SMTP with the mail server you are using right ? do you own that mail server ? can you turn off SSL to check if the problem is the SSL competability ? Click to expand... same problem with ssl. and I cant quite say we own the mail server but we do lease a dedicated Windows VPS running Mail Enable Mail Server.
melamoud said: SO I guess the problem is competability of thje net lib implmentation of SMTP with the mail server you are using right ? do you own that mail server ? can you turn off SSL to check if the problem is the SSL competability ? Click to expand... same problem with ssl. and I cant quite say we own the mail server but we do lease a dedicated Windows VPS running Mail Enable Mail Server.