web stats
Problem in Sending e-mail - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 07-24-2015, 06:42 AM
vibinChander vibinChander is offline
OBX.2 Kenobi
 
Join Date: Jul 2015
Location: Chennai
Posts: 74
vibinChander is on a distinguished road
Send a message via Skype™ to vibinChander
Default Problem in Sending e-mail

Hi, after working a while, I'm curious to send the mail using Javascript function.I used the function in the reference section.

I'm using the following code below but I'm getting
"Wrapped java.lang.NumberFormatException: null " error in the following code.

Tried the last part using 'charset' then I'm getting this error:
"Wrapped java.nio.charset.UnsupportedCharsetException: charset"

Complete code:
var smtpConn = SMTPConnectionFactory.createSMTPConnection();
smtpConn.send('vibinernesto@gmail.com', '', 'vibinernesto@gmail.com', 'Try', 'body', '');
Reply With Quote
  #2  
Old 07-24-2015, 07:42 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,099
narupley is on a distinguished road
Default

You need to use an actual charset (like US-ASCII), not literally the word "charset".
__________________
Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

Nicholas Rupley
Work: 949-237-6069
Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


- How do I foo?
- You just bar.
Reply With Quote
  #3  
Old 07-24-2015, 08:38 AM
vibinChander vibinChander is offline
OBX.2 Kenobi
 
Join Date: Jul 2015
Location: Chennai
Posts: 74
vibinChander is on a distinguished road
Send a message via Skype™ to vibinChander
Question Still doesn't Work

I tried with "UTF-8" and "US-ASCII" in terms of the 'charset' I still receive the same error.

"Wrapped java.lang.NumberFormatException: null"
Reply With Quote
  #4  
Old 07-24-2015, 08:40 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,099
narupley is on a distinguished road
Default

It could be coming from somewhere else in your channel. It's hard to tell when you don't post entire stacktraces or the channel in question.
__________________
Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

Nicholas Rupley
Work: 949-237-6069
Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


- How do I foo?
- You just bar.
Reply With Quote
  #5  
Old 07-24-2015, 08:53 AM
vibinChander vibinChander is offline
OBX.2 Kenobi
 
Join Date: Jul 2015
Location: Chennai
Posts: 74
vibinChander is on a distinguished road
Send a message via Skype™ to vibinChander
Default Provided here!

I've proided the entire error I've received while running this code.

CHANNEL: File-Test
CONNECTOR: sourceConnector
SCRIPT SOURCE: TRANSFORMER
SOURCE CODE:
38:
39: var k=JSON.stringify(obj);
40: logger.info("JSON format:"+k);
41:
42: var smtpConn = SMTPConnectionFactory.createSMTPConnection();
43: smtpConn.send('vibinernesto@gmail.com', 'cc', 'vibinernesto@gmail.com', 'Try-fom mirth', 'Test-try', 'UTF-8');
44: if ('xml' === typeof msg && msg.hasSimpleContent()) { msg = msg.toXMLString(); }if ('xml' === typeof tmp && tmp.hasSimpleContent()) { tmp = tmp.toXMLString(); }
45: }
46: if (doFilter() == true) { doTransform(); return true; } else { return false; }
47: }
LINE NUMBER: 43
DETAILS: Wrapped java.lang.NumberFormatException: null
at 4ac89f4a-5e8c-4000-9f84-118aed7e0e54:43 (doTransform)
at 4ac89f4a-5e8c-4000-9f84-118aed7e0e54:46 (doScript)
at 4ac89f4a-5e8c-4000-9f84-118aed7e0e54:48
at com.mirth.connect.server.transformers.JavaScriptFi lterTransformer$FilterTransformerTask.call(JavaScr iptFilterTransformer.java:134)
at com.mirth.connect.server.transformers.JavaScriptFi lterTransformer$FilterTransformerTask.call(JavaScr iptFilterTransformer.java:100)
at java.util.concurrent.FutureTask$Sync.innerRun(Unkn own Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker( Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NumberFormatException: null
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at com.mirth.connect.server.util.ServerSMTPConnection .send(ServerSMTPConnection.java:115)
at com.mirth.connect.server.userutil.SMTPConnection.s end(SMTPConnection.java:230)
at sun.reflect.GeneratedMethodAccessor52.invoke(Unkno wn Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.mozilla.javascript.MemberBox.invoke(MemberBox. java:126)
at org.mozilla.javascript.NativeJavaMethod.call(Nativ eJavaMethod.java:225)
at org.mozilla.javascript.Interpreter.interpretLoop(I nterpreter.java:1473)
at org.mozilla.javascript.Interpreter.interpret(Inter preter.java:815)
at org.mozilla.javascript.InterpretedFunction.call(In terpretedFunction.java:109)
at org.mozilla.javascript.ContextFactory.doTopCall(Co ntextFactory.java:394)
at org.mozilla.javascript.ScriptRuntime.doTopCall(Scr iptRuntime.java:3110)
at org.mozilla.javascript.InterpretedFunction.exec(In terpretedFunction.java:120)
at com.mirth.connect.server.util.javascript.JavaScrip tTask.executeScript(JavaScriptTask.java:49)
at com.mirth.connect.server.transformers.JavaScriptFi lterTransformer$FilterTransformerTask.call(JavaScr iptFilterTransformer.java:123)
... 6 more
Reply With Quote
  #6  
Old 07-08-2016, 04:53 PM
nthan nthan is offline
What's HL7?
 
Join Date: Jul 2011
Posts: 1
nthan is on a distinguished road
Default Email Settings are not set

I had the same issue. I guess you didn't set the value in email settings.
So in Settings, there is a section for Email, where you need to enter: SMTP Host, SMTP Port, Send Timeout(ms), Default From Address, Secure Connection, Require Authentication, Username and Password.
Put the information required for your situation there and try again.
After I have these information filled correctly, no more error occurs.

Good luck

N
Attached Images
File Type: png mirth_email_settings_removed.png (54.9 KB, 39 views)
Reply With Quote
Reply

Tags
email, mirth 3.2.0

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 04:33 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Mirth Corporation