Hi,
I am trying to write a simple code to send an email. Below is sample code,
…
MailMessage mssg= new MailMessage("FromEmail@domain.com", "ToEmail@domain.com", “First Message from Java”, “Body”);
SmtpClient client = new SmtpClient(host, port, userName, password);
client.setSecurityOptions(SecurityOptions.Auto);
client.send(mssg);
…
I am using aspose-email-17.4.0-jdk16 jar file.
While running the code, I am getting below exceptions
Exception in thread “main” AsposeException
—> AsposeException
—> java.lang.NullPointerException
— End of inner exception stack trace —
[Ljava.lang.StackTraceElement;@19d37183
— End of inner exception stack trace —
[Ljava.lang.StackTraceElement;@1a0dcaa
at com.aspose.email.auh.a(SourceFile:159)
at com.aspose.email.gz.g(SourceFile:658)
at com.aspose.email.gz.B(SourceFile:590)
at com.aspose.email.gz.a(SourceFile:571)
at com.aspose.email.SmtpClient.a(SourceFile:1847)
at com.aspose.email.SmtpClient.a(SourceFile:1819)
at com.aspose.email.SmtpClient.send(SourceFile:1638)
at ExampleSend.checkMessageForward(ExampleSend.java:37)
at ExampleSend.main(ExampleSend.java:13)
Caused by: AsposeException
—> java.lang.NullPointerException
— End of inner exception stack trace —
[Ljava.lang.StackTraceElement;@fdefd3f
at com.aspose.email.auh.b(SourceFile:247)
at com.aspose.email.auh.a(SourceFile:24)
at com.aspose.email.aui.a(SourceFile:133)
at com.aspose.email.internal.af.h.a(Unknown Source)
at com.aspose.email.internal.af.j.run(Unknown Source)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException
at com.aspose.email.internal.ei.c$a.a(SourceFile:529)
at com.aspose.email.internal.ei.c$a.(SourceFile:433)
at com.aspose.email.internal.ei.c.a(SourceFile:86)
at com.aspose.email.aio.a(SourceFile:53)
at com.aspose.email.auh.a(SourceFile:410)
at com.aspose.email.auh.a(SourceFile:377)
at com.aspose.email.auh.b(SourceFile:234)
… 5 more
Please help me to resolve this issue.