Did anyone face this issue - Null pointer exception while sending email 
from OrientDB

I did same what has been explained 
here https://github.com/orientechnologies/orientdb/wiki/Mail-Plugin
Still getting Null pointer exception.

*Reproduce this issue:*

1. Set email profile as below in config fileorientdb-server-config.xml
              <!-- MAIL, TO TURN ON SET THE 'ENABLED' PARAMETER TO 'true' 
-->
<handler 
class="com.orientechnologies.orient.server.plugin.mail.OMailPlugin">
  <parameters>
<parameter name="enabled" value="true" />
<!-- CREATE MULTIPLE PROFILES WITH profile.<name>... -->
<parameter name="profile.default.mail.smtp.host" value="smtp.gmail.com"/>
<parameter name="profile.default.mail.smtp.port" value="465" />
<parameter name="profile.default.mail.smtp.auth" value="true" />
<parameter name="profile.default.mail.smtp.starttls.enable" value="true" />
<parameter name="profile.default.mail.smtp.user" value="<<
*[email protected]>>*" />
<parameter name="profile.default.mail.smtp.password" value="<<
*yourpassword>>*" />
<parameter name="profile.default.mail.date.format" value="yyyy-MM-dd 
HH:mm:ss" />
  </parameters>
</handler>

2. Restart the OrientDB server.
3. Write JS function in OrientDB with below code to send email:

mail.send({
  profile: "default",
  to: "*<<[email protected]>>*",
  cc: "*<<[email protected]>>*",
  subject: "The EMail plugin works",
  message : "Sending email from OrientDB Server is so powerful to build 
real web applications!"
});
return "Sent email";

*In above code, replace text in <<>> with your suitable emails.*

4. Invoke the JS function over REST, you will see the null pointer 
exception.

Kindly suggest the root cause and possible solution or workaround.

Regards,
Gaurav




On Tuesday, March 4, 2014 6:14:53 PM UTC+5:30, Gaurav Dhiman wrote:
>
> Hi,
>
> I tried to send the email from server side JS function on localhost as 
> explained on below link:
> https://github.com/orientechnologies/orientdb/wiki/Mail-Plugin
>
> Got below error:
>
> *Error on parsing script at position #0: Error on execution of the script
> Script: sendEMail
> ------^
> sun.org.mozilla.javascript.internal.WrappedException: Wrapped 
> java.lang.NullPointerException (<Unknown source>#20) in <Unknown source> at 
> line number 20
> Wrapped java.lang.NullPointerException (<Unknown source>#20)
> null*
>
>
> Mail plugin loaded successfully and even default profile is identified as 
> shown on server start.
>
> Any clue, why this error ? Error says null pointer, but where is the null 
> pointer ?
>
> Best Regards,
> Gaurav
>
>  

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to