Problem while sending mail through posprocess event hadler inOIM 11g r2
Hi,
i am sending mail through posprocess event hadler inOIM 11g r2 when user is created.But i am getting following error in resolver class.
java.lang.NullPointerException
at oracle.iam.identity.usermgmt.impl.UserDetailsProviderImpl.getUserDetails(UserDetailsProviderImpl.java:102)
at oracle.iam.notification.impl.util.NotificationUtil.getUserPreferences(NotificationUtil.java:83)
at oracle.iam.notification.impl.NotificationServiceImpl.notify(NotificationServiceImpl.java:523)
at oracle.iam.notification.impl.NotificationServiceImpl.notify(NotificationServiceImpl.java:271)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at oracle.iam.platform.utils.DMSMethodInterceptor.invoke(DMSMethodInterceptor.java:25)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at oracle.iam.notification.impl.util.NotificationUtil.getUserPreferences(NotificationUtil.java:83)
at oracle.iam.notification.impl.NotificationServiceImpl.notify(NotificationServiceImpl.java:523)
at oracle.iam.notification.impl.NotificationServiceImpl.notify(NotificationServiceImpl.java:271)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at oracle.iam.platform.utils.DMSMethodInterceptor.invoke(DMSMethodInterceptor.java:25)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
Edited by: 853559 on Sep 25, 2012 6:27 AM
If you are using Custom Notification XML, make sure to have StaticData element in it. StaticData defines the entitites that can be used in the notification template, and these entities attributes are used to define substitution tokens in the template.
Similar Messages
-
Uncaught Exception occured while sending mail through abap code.
Hi,
Uncaught Exception occured while sending mail through abap code.Run time Errors "UNCAUGHT_EXCEPTION" occured after excuting the call method CALL METHOD SEND_REQUEST->SEND( ).kindly help in resolving the issue.HI,
Runtime Error: UNCAUGHT_EXCEPTION details.
Runtime Errors UNCAUGHT_EXCEPTION
Exception CX_ADDRESS_BCS
Short text
An exception occurred that was not caught.
What happened?
The exception 'CX_ADDRESS_BCS' was raised, but it was not caught anywhere along
the call hierarchy.
Since exceptions represent error situations and this error was not
adequately responded to, the running ABAP program 'SAPLZSEND_MAIL' has to be
terminated.
Error analysis
An exception occurred that is explained in detail below.
The exception, which is assigned to class 'CX_ADDRESS_BCS', was not caught in
procedure "SEND_MAIL" "(FORM)", nor was it propagated by a RAISING clause.
Since the caller of the procedure could not have anticipated that the
exception would occur, the current program is terminated.
The reason for the exception is:
An exception occurred
How to correct the error
If the error occures in a non-modified SAP program, you may be able to
find an interim solution in an SAP Note.
If you have access to SAP Notes, carry out a search with the following
keywords:
"UNCAUGHT_EXCEPTION" "CX_ADDRESS_BCS"
"SAPLZSEND_MAIL" or "LZSEND_MAILU01"
"ZSEND_EMAIL"
If you cannot solve the problem yourself and want to send an error
notification to SAP, include the following information:
1. The description of the current problem (short dump)
To save the description, choose "System->List->Save->Local File
(Unconverted)".
2. Corresponding system log
Display the system log by calling transaction SM21.
Restrict the time interval to 10 minutes before and five minutes
after the short dump. Then choose "System->List->Save->Local File
(Unconverted)".
3. If the problem occurs in a problem of your own or a modified SAP
program: The source code of the program
In the editor, choose "Utilities->More
Utilities->Upload/Download->Download".
4. Details about the conditions under which the error occurred or which
actions and input led to the error.
The exception must either be prevented, caught within proedure
"SEND_MAIL" "(FORM)", or its possible occurrence must be declared in the
RAISING clause of the procedure.
Please help me to resolve this issue. -
Problem in sending mail through dynamics actions
Hi Friends,
I have a problem in sending mail through dynamics actions . In this we pass a subroutine in dynamics actions which send an mail when promotion action occured.
Problem is that sometimes it will send an mail or sometimes not. I have no idea to solve this problem.
Can anyone suggest me .
Thanks ,
Anish
Moderator message : Duplicate post locked.
Edited by: Vinod Kumar on Sep 5, 2011 9:45 AMHi,
Check that all the bindings have been done in proper way as it is configured.. Try to do the binding manualy..This could also be the problem..
thank You -
Problem in sending mail through workflow
Hi All,
I am trying to create a workflow. I created a workflow and once document is made, this workflow trigerrs and i am able to get user decision to my user id. once if i click on approve, mail should be triggered to my mail id. but mail is not coming to my mail id. i checked in SOST transaction, <b>mail status set to Transmitted.</b>, and not as sent .
But i tested a sample test message from sbwp to my mail id and it is working fine. Only through workflow, sending message to outlook is not working. i checked my user in the system in SU01 transaction also, there also mail id is mentioned. what could be reason for not able to send mails through workflow.?
Its urgent.
Points will be awarded to all.
Regards,
vinothHi,
Check that all the bindings have been done in proper way as it is configured.. Try to do the binding manualy..This could also be the problem..
thank You -
Problem while sending mail inOIM 11g r2 after usercreation
Hi,
By default OIM sends mail to user mail id when the user created. i have tested this scenario using test mail server, it is working fine . when i am trying this scenario using exchange mail server, it is throwing errors. for Exchange just i have changed IT resource parameters.
Authentication true
Server Name ip address of the Exchange server
User Login [email protected]
User Password *************
is there anything missing. for SMTP server is ums nedded ?.
<Oct 1, 2012 7:07:51 AM EDT> <Error> <oracle.iam.notification.impl> <BEA-000000> <Provider UMSEmailServiceProvider has encountered exception : javax.xml.soap.SOAPException: javax.xml.soap.SOAPException: Message send failed: Connection refused>
<Oct 1, 2012 7:07:51 AM EDT> <Error> <oracle.iam.notification.impl> <BEA-000000> <Sending notification with Provider UMSEmailServiceProvider has encountered exception : Error occured while Sending Notification through Provider UMSEmailServiceProvider : javax.xml.soap.SOAPException: javax.xml.soap.SOAPException: Message send failed: Connection refused>
<Oct 1, 2012 7:07:51 AM EDT> <Error> <oracle.iam.notification.impl> <BEA-000000> <Sending notification with Provider UMSEmailServiceProvider detailed exception : javax.xml.soap.SOAPException: javax.xml.soap.SOAPException: Message send failed: Connection refused>
<Oct 1, 2012 7:07:52 AM EDT> <Error> <oracle.iam.notification.provider> <BEA-000000> <300>
<Oct 1, 2012 7:07:52 AM EDT> <Error> <oracle.iam.notification.impl> <BEA-000000> <Provider SOAEmailServiceProvider has encountered exception : java.lang.IllegalArgumentException: 300>
<Oct 1, 2012 7:07:52 AM EDT> <Error> <oracle.iam.notification.impl> <BEA-000000> <Sending notification with Provider SOAEmailServiceProvider has encountered exception : Error occured while Sending Notification through Provider SOAEmailServiceProvider : java.lang.IllegalArgumentException: 300>
<Oct 1, 2012 7:07:52 AM EDT> <Error> <oracle.iam.notification.impl> <BEA-000000> <Sending notification with Provider SOAEmailServiceProvider detailed exception : java.lang.IllegalArgumentException: 300>
<Oct 1, 2012 7:07:52 AM EDT> <Error> <oracle.iam.notification.impl> <BEA-000000> <Provider EmailServiceProvider has encountered exception : null>
Thanks,Given below steps in oracle doc for UMS configuration. you can try the same
Configuring UMS Provider for Sending Notifications (Optional)
To configure Unified Messaging Service (UMS) provider for sending notifications:
Edit the oim-config.xml file by using MBeans. To do so:
Log in to Oracle Enterprise Manager.
Navigate to Identity and Access, oim.
Right-click oim(11.1.1.x.x), and select System MBean Browser.
In the System MBean Browser, navigate to Application Defined MBeans, oracle.iam, Server: oim_server1, Application:oim, XMLConfig, Config, XMLConfig.NotificationConfig, EmailProvider.
Click the EmailProvider attribute, and replace the value oracle.iam.notification.provider.EmailServiceProvider with oracle.iam.notification.provider.UMSEmailServiceProvider.
Click Apply.
Configure the Email Provider Instance - UMS IT resource with the UMS Web service details. To do so:
Login to Oracle Identity Manager Administrative and User Console, and navigate to Advanced Administration.
Click the Configuration tab, click Resource Management, and then click Manage IT Resource.
Click Search. The list of IT resources is displayed.
For the Email Provider Instance - UMS IT resource, click the Edit icon. The Edit IT Resource Details and Parameters page is displayed.
Specify values in the following fields:
Web service URL: The URL of the UMS web service to be invoked. For example, http://<SOA_host>:<SOA_Port>/ucs/messaging/webservice.
Policies: The OWSM policy attached to the given web service. Leave this field as blank.
Username: The username provided in the security header. If no policy is attached, then leave this field as blank.
Password: The password provided in the security header. If no policy is attached, then leave this field as blank.
Click Apply, and then close the popup window.
Configure UMS Server for using a mail server other than the local LINUX mail server, which is picked by default. For example, to setup the mail server to use stbeehive email server:
Stop the Linux Local sendmail email server running on the host, if this is a LINUX host, by running the following command:
/usr/local/redhat/packages/aime/ias/run_as_root "/sbin/service sendmail stop"
Configure Mail Server information in UMS Email Driver. To do so:
i. Login to Oracle Enterprise Manager.
ii. Expand User Messaging Service, and select usermessagingdriver-email (soa_server1).
iii. From the Driver-Specific Configuration list, select Email Driver Properties.
iv. Configure the following mandatory fields:
OutgoingMailServer: The name of the SMTP server, for example, mailserver.mycompany.com.
OutgoingMailServerPort: The port number of the SMTP server, for example, 465.
OutgoingMailServerSecurity: The security setting used by the SMTP server. Possible values can be None, TLS, or SSL.
OutgoingUsername: Any valid username similar to your mail client configuration, such as in the [email protected].
OutgoingPassword: The password used for SMTP authentication. This consists of the following fields:
Type of Password: Select Indirect Password, Create New User.
Indirect Username/Key: Enter a unique string, for example, OIMEmailConfig. This masks the password and does not expose it in clear text in the configuration file.
Password: Enter a valid password for this account.
v. Click Apply.
Right-click usermessagingdriver-email (soa_server1), and select Control, Shutdown.
Allow at least 2 minutes to pass, after which you can restart the email driver. To so so, right-click usermessagingdriver-email (soa_server1), and select Control, Restart. -
Problem while sending mail inOIM 11g r2
HI,
i am getting following error while sending mail in OIM 11G r2
<Jun 13, 2012 12:53:25 AM PDT> <Warning> <oracle.adfinternal.view.faces.renderkit.rich.SelectItemUtils> <ADF_FACES-30118> <No help provider found for helpTopicId=create_user.>
java.net.MalformedURLException: For input string: "SOA_PORT"
at java.net.URL.<init>(URL.java:601)
at java.net.URL.<init>(URL.java:464)
at java.net.URL.<init>(URL.java:413)
at java.net.URI.toURL(URI.java:1081)
at oracle.j2ee.ws.common.transport.HttpTransport.transmit(HttpTransport.java:61)
at oracle.j2ee.ws.common.async.MessageSender.call(MessageSender.java:64)
at oracle.j2ee.ws.common.async.Transmitter.transmitSync(Transmitter.java:134)
at oracle.j2ee.ws.common.async.Transmitter.transmit(Transmitter.java:90)
at oracle.j2ee.ws.common.async.RequestorImpl.transmit(RequestorImpl.java:273)
at oracle.j2ee.ws.common.async.RequestorImpl.invoke(RequestorImpl.java:94)
at oracle.j2ee.ws.client.jaxws.DispatchImpl.invoke(DispatchImpl.java:811)
at oracle.j2ee.ws.client.jaxws.OracleDispatchImpl.synchronousInvocationWithRetry(OracleDispatchImpl.java:235)
at oracle.j2ee.ws.client.jaxws.OracleDispatchImpl.invoke(OracleDispatchImpl.java:106)
at oracle.j2ee.ws.client.jaxws.WsClientProxyInvocationHandler.invoke(WsClientProxyInvocationHandler.java:254)
at $Proxy422.send(Unknown Source)
But it is known issue in OIM 11gr2 .
solution is The cause of this error is malformed URL. To resolve the issue, provide the correct values for SOA_PORT and SOA_HOST in Enterprise Manager (EM).
BUT i didn't find the SOA_PORT,SOA_HOST in EM console.
Thanks,
Edited by: 853559 on Sep 20, 2012 3:09 AM. Follow the steps mentioned below to configure the workflow notification properties:
• Login to EM console as weblogic user.
• Expand SOA.
• Right click on <soa-infra> ANY ONE WILL BE REFLECTED. Select SOA Administration --> Workflow notification properties
• Select "Email" from “Notification Mode” list
• Provide notification service field values as:
o Email : From Address * : [email protected]
o Email : Actionable Address : [email protected]
o Email : Reply To Address: [email protected]
• Click Apply
• Click "Go to the Messaging Driver page" link
• Select configure driver: Provide Driver-Specific Configuration as:
o MailAccessProtocol : IMAP
o ReceiveFolder : INBOX
o OutgoingMailServer : smtp.sample.com
o OutgoingMailServerPort : 25
o OutgoingDefaultFromAddress : [email protected]
• Click Apply
If you are sending mail through xelsysadm account then change the value of “Email” field of that account .
Also configure Email Server ITResource .
Edited by: IAM_TECH on Sep 20, 2012 3:48 PM -
PROBLEM WHILE SENDING MAILS TO MUTILPLE RECIPIENTS
hi,
while sending mails to multiple recipients,if any one of the mail id is invalid the mail is not being send to other valid mailids,how can this problem be resolved , so that other than the invalid recipient mail has to be send to other valid mailidsCOULD YOU PLEASE STOP SHOUTING?
CAN YOU TALK LOUDER, I CAN'T HEAR YOU! -
Problem while sending FAX through PRINT_TEXT FM
Hi All,
I have a problem while sending a fax.
we are sending fax through the FM PRINT_TEXT.
Below is the FM we are passing paramenters.
CALL FUNCTION 'PRINT_TEXT'
EXPORTING
APPLICATION = 'TX'
DEVICE = 'TELEFAX'
DIALOG = SPACE
HEADER = fs_header
OPTIONS = fs_popt
IMPORTING
RESULT = fs_pres
TABLES
LINES = <b>int_fax</b>
EXCEPTIONS
CANCELED = 1
DEVICE = 2
FORM = 3
OPTIONS = 4
UNCLOSED = 5
UNKNOWN = 6
FORMAT = 7
TEXTFORMAT = 8
COMMUNICATION = 9
BAD_PAGEFORMAT_FOR_PRINT = 10
OTHERS = 11.
if sy-subrc ne 0.
p_flag = lit_x.
endif.
In INT_FAX internal table we have two fields one is tdformat second one is tdline
The lengh of the TDLINE is 132 char,Initially for all reocords we have only 108 char length,But according to user requirement we added one more field in taht
Now the lengh increased to 132 for each records.
When i checked in debugg mode the INT_FAX internal table have all 132 characters.
The problem is while checking in SOST trnasaction it is showing 108 characters in one line and remaining in second line,can you please help on this.
Thanks In advance
Sriman.may it be that in those cases where it doesnt work, that you got no fax number?
Since it works soemtimes, it seems there are no errors, but rather in some cases some important info is missing, fax number may be one of thsoe important info in a FAX scenario. -
Error while sending mail through SMTP
Hi,
We are getting the following error while trying to send mail through SMTP.
'554 ERROR_MESSAGE_STATE: SMTP_NO_HANDLER( host:1-,subrc:0001)'
Please advice,
Regards,
SamHi All,
Configured SMTP as per the note 455140,i can able to send mails from SAP to the out side world,
mails in SAP.When i tried the test to check whether the SAP system is correctly set up to receive e-mails as per the note 607108, iam getting a connection closed message as below.
afgdev:pgdadm> telnet afgdev 2500
Trying...
Connected to afgdev.
Escape character is '^]'.
220 afgdev.abc.ae SAP 6.40(52) ESMTP service ready
helo afgdev
250 afgdev.abc.ae
mail from:<[email protected]>
250 Ok
rcpt to:<[email protected]>
250 Ok
data
354 Enter mail, end with "."
Hello,This is a test.
Connection closed.
afgdev:pgdadm>
rgds
Sam -
Urgent!!!! Problem in sending mail through yahoo mail server
Hi
I have a yahoo account and I want to send email through yahoo mail server
using my java program. My program supports SMTP server authentication.
But when I connect to the yahoo mail server(smtp.mail.yahoo.com) I got this error
javax.mail.MessagingException: 521 yahoo.com closing transmission channel. You
must be pop-authenticated before you can use this smtp server, and you must use
your yahoo mail address for the Sender/From field.
This is my program
import javax.mail.*;
import java.util.*;
import javax.mail.internet.*;
import javax.mail.event.*;
import java.io.*;
public class JavaMailUserAgent
Properties properties;
Session session;
Message message;
JavaMailUserAgent(String mailHost,String smtpUsername,String smtpPassword) throws Exception
properties=new Properties();
properties.put("mail.smtp.host",mailHost);
ServerAuthenticate auth=new ServerAuthenticate(smtpUsername,smtpPassword);
session=Session.getInstance(properties,auth);
message=new MimeMessage(session);
} //**********************************************************************end constructor
void sendMail(String messageFrom,String messageTo,String subject,String messageBody) throws Exception
properties.put("mail.from",messageFrom);
InternetAddress[] address={ new InternetAddress(messageTo) };
message.setFrom(new InternetAddress(messageFrom));
message.setRecipients(Message.RecipientType.TO,address);
message.setSubject(subject);
message.setContent(messageBody,"text/plain");
Transport transport=session.getTransport(address[0]);
transport.addConnectionListener(new ConnectionHandler());
transport.addTransportListener(new TransportHandler());
transport.connect();
transport.sendMessage(message,address);
} //*************************************************************************end function
} //*************************************************************************************end main
class ConnectionHandler extends ConnectionAdapter
public void opened(ConnectionEvent e)
System.out.println("connection opened");
public void disconnected(ConnectionEvent e)
System.out.println("connection disconnected");
public void closed(ConnectionEvent e)
System.out.println("connection closed");
} //*************************************************************************************end main
class TransportHandler extends TransportAdapter
public void messageDelivered(TransportAdapter e)
System.out.println("message delivered");
public void messageNotDelivered(TransportAdapter e)
System.out.println("message NOT delivered");
public void messagePartiallyDelivered(TransportAdapter e)
System.out.println("message partially delivered");
} //*************************************************************************************end main
class ServerAuthenticate extends Authenticator
String smtpUsername = null;
String smtpPassword = null;
public ServerAuthenticate(String username, String password)
smtpUsername = username;
smtpPassword = password;
protected PasswordAuthentication getPasswordAuthentication()
return new PasswordAuthentication(smtpUsername,smtpPassword);
} //*************************************************************************************end main
I use this code to call the program.
JavaMailUserAgent jmail=new JavaMailUserAgent("smtp.mail.yahoo.com","my_yahoo_username","my_yahoo_password");
jmail.sendMail("[email protected]","[email protected]","test subject","test message");
Could you pls tell me why do I get this error eventhough My program has server authentication.
Is this my program error.Please Helpl me what to do to correct this problem.
Please include a sample code
thanks for listening
sabuI have used the code below to send mail from yahoo account,but I got the error message like below,what I should configure in pop3 of yahoo account????
import javax.mail.*;
import java.util.*;
import javax.mail.internet.*;
import javax.mail.event.*;
import java.io.*;
public class JavaMailUserAgent
Properties properties;
Session session;
Message message;
JavaMailUserAgent(String mailHost,String smtpUsername,String smtpPassword) throws Exception
properties=new Properties();
properties.put("mail.smtp.host",mailHost);
ServerAuthenticate auth=new ServerAuthenticate(smtpUsername,smtpPassword);
session=Session.getInstance(properties,auth);
message=new MimeMessage(session);
//**********************************************************************end constructor
void sendMail(String messageFrom,String messageTo,String subject,String messageBody) throws Exception
properties.put("mail.from",messageFrom);
InternetAddress[] address={ new InternetAddress(messageTo) };
message.setFrom(new InternetAddress(messageFrom));
message.setRecipients(Message.RecipientType.TO,address);
message.setSubject(subject);
message.setContent(messageBody,"text/plain");
Transport transport=session.getTransport(address[0]);
transport.addConnectionListener(new ConnectionHandler());
transport.addTransportListener(new TransportHandler());
transport.connect();
transport.sendMessage(message,address);
} //*************************************************************************end function
} //*************************************************************************************end main
class ConnectionHandler extends ConnectionAdapter
public void opened(ConnectionEvent e)
System.out.println("connection opened");
public void disconnected(ConnectionEvent e)
System.out.println("connection disconnected");
public void closed(ConnectionEvent e)
System.out.println("connection closed");
} //*************************************************************************************end main
class TransportHandler extends TransportAdapter
public void messageDelivered(TransportAdapter e)
System.out.println("message delivered");
public void messageNotDelivered(TransportAdapter e)
System.out.println("message NOT delivered");
public void messagePartiallyDelivered(TransportAdapter e)
System.out.println("message partially delivered");
} //*************************************************************************************end main
class ServerAuthenticate extends Authenticator
String smtpUsername = null;
String smtpPassword = null;
public ServerAuthenticate(String username, String password)
smtpUsername = username;
smtpPassword = password;
protected PasswordAuthentication getPasswordAuthentication()
return new PasswordAuthentication(smtpUsername,smtpPassword);
public static void main(String str[])throws Exception
JavaMailUserAgent jmail=new
JavaMailUserAgent("smtp.mail.yahoo.com","[email protected]","passwordd");
jmail.sendMail("[email protected]","[email protected]","test subject","test message");
ERROR:
E:\mail\javamail\servlet>java ServerAuthenticate
connection opened
Exception in thread "main" javax.mail.MessagingException: 530 authentication req
uired - for help go to http://help.yahoo.com/help/us/mail/pop/pop-11.html
at com.sun.mail.smtp.SMTPTransport.issueCommand(SMTPTransport.java:879)
at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:599)
at com.sun.mail.smtp.SMTPTransport.sendMessage(Compiled Code)
at JavaMailUserAgent.sendMail(JavaMailUserAgent.java:58)
at ServerAuthenticate.main(JavaMailUserAgent.java:131)
How Could I rectyfy the above error ?????
Regards,
Mahesh. -
While sending mail through applet
Hi All,
I have a problem while using the following code in my applet
Here is the code i got the exception.
public void postMail( String smtpHost, String recipients[], String subject,
String message , String file, String from) throws MessagingException
boolean debug = false;
//Set the host smtp address
Properties props = new Properties();
props.put("mail.smtp.host", smtpHost);
props.put("mail.smtp.auth", "true");
Authenticator auth = new SMTPAuthenticator();
Session session = Session.getDefaultInstance(props, auth);
session.setDebug(debug);
// create a message
Message msg = new MimeMessage(session);
// set the from and to address
InternetAddress addressFrom = new InternetAddress(from);
msg.setFrom(addressFrom);
InternetAddress[] addressTo = new InternetAddress[recipients.length];
for (int i = 0; i < recipients.length; i++)
addressTo[i] = new InternetAddress(recipients);
msg.setRecipients(Message.RecipientType.TO, addressTo);
// Setting the Subject and Content Type
msg.setSubject(subject);
msg.setSentDate(new Date());
if(!file.equals(""))
BodyPart messageBodyPart = new MimeBodyPart();
// Fill the message
messageBodyPart.setText(message);
Multipart multipart = new MimeMultipart();
multipart.addBodyPart(messageBodyPart);
// Part two is attachment
messageBodyPart = new MimeBodyPart();
DataSource source = new FileDataSource(file);
messageBodyPart.setDataHandler(new DataHandler(source));
messageBodyPart.setFileName((new File(file)).getName());
multipart.addBodyPart(messageBodyPart);
msg.setContent(multipart);
else msg.setContent(message, "text/plain");
Transport.send(msg);
---->exception
Exception in thread "AWT-EventQueue-2" java.lang.NoClassDefFoundError: javax/mail/MessagingException
And -->
Exception in thread "AWT-EventQueue-2" java.lang.NoClassDefFoundError: javax/mail/Authenticator
i set the jar file mail.jar and activation.jar file in tomcat webserver
webapp/ myproj/lib
Can any one please help me???
Thanks,
KiranThe JVM can't find JavaMail or the JavaBeans Activation Framework (JAF) on the classpath.
Assuming your applet is packaged in a JAR file, you'll need the "archive" attribute to specify not just your applet's JAR file but also the JavaMail and JAF JARs too, so all 3 get downloaded to the browser.
<applet archive="your.jar,mail.jar,activation.jar" ... />
Alternatively you can permanently install JavaMail and JAF on the client machine (PATH_TO_JRE/lib/ext folder).
However, the default applet security policy won't allow connections to machines other than the one from which the applet was downloaded. You will have to change the policy on the client to allow SMTP connections. (To put it another way, if you do get the JavaMail/JAF classes sent to the browser, you'll get SecurityExceptions.)
A better (?) way of doing this would be to have a servlet that the applet can make requests to, and have the server send the mail. -
Problem while sending fax through a SAP Smart Form
Hi,
I am trying to send fax through a smartform but it is not working, please see the details below.
I am calling the Function Module "SSF_FUNCTION_MODULE_NAME" in a PAI event. After storing the FM name "/1BCDWB/SF00000029"in a local variable "ls_frm_name", I am using that for printing the Form and at the same time to fax out the same by passing the following export parameters.
control_parameters type ssfctrlop with values
la_ssfctrlop_struc-device = 'TELEFAX'.
la_ssfctrlop_struc-no_dialog = 'X'.
la_ssfctrlop_struc-langu = ls_supplier_info-spras.
output_options type ssfcompop with values
ls_ssffaxop_struc-tdteleland = ls_supplier_info-land1.
ls_ssffaxop_struc-tdtelenum = lfa1-telfx.
ls_ssffaxop_struc-tdfaxuser = syst-uname.
ls_ssffaxop_struc-tdnoprint = 'X'.
along with "fax_details = ls_zap1_fax_details" declared as interface parameters to the Smart Form.
But the Function Module is throwing following exception and not sending any Fax.
SY-MSGID-->OL
SY-MSGNO-->356
SY-MSGV1-->NOAUTHORITYCHECK
Do I need to pass any other values to the FM, I felt that this is not an authorization problem after debugging.
Can any one please help me in handling this exception and send the fax,
Thanks,
Srinivas.
Edited by: Venkata Srinivas Inavilli on May 20, 2008 2:40 PMmay it be that in those cases where it doesnt work, that you got no fax number?
Since it works soemtimes, it seems there are no errors, but rather in some cases some important info is missing, fax number may be one of thsoe important info in a FAX scenario. -
Problem while sending mail to external mail ids
Hi All,
while trying to send mail to external mail ids through some custom program, i'm facing an error as "recipient not in address management".
Can anyone giude me why this is occuring and actually what is this Address management?
Thanks & Regards,
Anil.Hi,
Check this sample code..
http://www.sapdevelopment.co.uk/reporting/email/email_mbody.htm
* Add the recipients email address
clear it_receivers.
refresh it_receivers.
<b> it_receivers-receiver = p_email.
it_receivers-rec_type = 'U'.
it_receivers-com_type = 'INT'.</b>
it_receivers-notif_del = 'X'.
it_receivers-notif_ndel = 'X'.
append it_receivers.
what Fm you are using..?are you specifying like above for e-mail address..
Regards
vijay -
Problems while sending mail using java mail
hi all,
the following are the errors i get while sending a mail from my smtp local host-
import javax.mail.*;
import javax.mail.internet.*;
import java.util.*;
import javax.mail.Authenticator;
import javax.mail.PasswordAuthentication;
public class SendEmail
public static void main(String[] args)
System.out.println(args.length);
if (args.length != 6)
System.out.println("usage: sendmessage <to> <from> <smtphost> <true|false> <subject> <text>");
System.exit(1);System.out.println("jj"+args.length);
SendEmail m=new SendEmail();
m.SendMessage(args[0],args[1], args[2], args[3], args[4], args[5]);
public static String SendMessage(String emailto, String emailfrom, String smtphost, String emailmultipart, String msgSubject, String msgText)
boolean debug = false; // change to get more information
String msgText2 = "multipart message";
boolean sendmultipart = Boolean.valueOf(emailmultipart).booleanValue();
// set the host
Properties props = new Properties();
props.put("mail.smtp.host",smtphost);
props.put("mail.smtp.starttls.enable","true");
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.sendpartial", "true");
Authenticator loAuthenticator = new SMTPAuthenticator();
System.out.println("f");
// create some properties and get the default Session
Session session = Session.getDefaultInstance(props, loAuthenticator );
session.setDebug(debug);
try
// create a message
Message msg = new MimeMessage(session);
// set the from
InternetAddress from = new InternetAddress(emailfrom);
msg.setFrom(from);
InternetAddress[] address =
new InternetAddress(emailto)
//InternetAddress ad=new InternetAddress(session);
msg.setRecipients(Message.RecipientType.TO, address);
System.out.println("fc");
msg.setSubject(msgSubject);
System.out.println("fvf");
if(!sendmultipart)
// send a plain text message
msg.setContent(msgText, "text/plain");
System.out.println("fif");
else
System.out.println("felsd");
// send a multipart message// create and fill the first message part
MimeBodyPart mbp1 = new MimeBodyPart();
mbp1.setContent(msgText, "text/plain");
// create and fill the second message part
MimeBodyPart mbp2 = new MimeBodyPart();
mbp2.setContent(msgText2, "text/plain");
// create the Multipart and its parts to it
Multipart mp = new MimeMultipart();
mp.addBodyPart(mbp1);
mp.addBodyPart(mbp2);
// add the Multipart to the message
msg.setContent(mp);
Transport transport = session.getTransport("smtp");
transport.connect(smtphost,"[email protected]","xyz");
msg.saveChanges();
System.out.println("fconn");
//transport.sendMessage(msg,msg.getAllRecipients());
transport.sendMessage(msg,msg.getAllRecipients());
transport.close();
//Transport.send(msg);
catch(MessagingException mex)
mex.printStackTrace();
return "Email sent to " + emailto;
class SMTPAuthenticator extends Authenticator
public PasswordAuthentication getPasswordAuthentication()
String username = "[email protected]";
String password = "xyz";
return new PasswordAuthentication(username, password);
i dont understand what the problem is..inspite of having the right code..
i guess some firewall problem..
can somebody help me please..il be highly obliged..thanks..hi all,
the following are the errors i get while sending a mail from my smtp local host-
import javax.mail.*;
import javax.mail.internet.*;
import java.util.*;
import javax.mail.Authenticator;
import javax.mail.PasswordAuthentication;
public class SendEmail
public static void main(String[] args)
System.out.println(args.length);
if (args.length != 6)
System.out.println("usage: sendmessage <to> <from> <smtphost> <true|false> <subject> <text>");
System.exit(1);System.out.println("jj"+args.length);
SendEmail m=new SendEmail();
m.SendMessage(args[0],args[1], args[2], args[3], args[4], args[5]);
public static String SendMessage(String emailto, String emailfrom, String smtphost, String emailmultipart, String msgSubject, String msgText)
boolean debug = false; // change to get more information
String msgText2 = "multipart message";
boolean sendmultipart = Boolean.valueOf(emailmultipart).booleanValue();
// set the host
Properties props = new Properties();
props.put("mail.smtp.host",smtphost);
props.put("mail.smtp.starttls.enable","true");
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.sendpartial", "true");
Authenticator loAuthenticator = new SMTPAuthenticator();
System.out.println("f");
// create some properties and get the default Session
Session session = Session.getDefaultInstance(props, loAuthenticator );
session.setDebug(debug);
try
// create a message
Message msg = new MimeMessage(session);
// set the from
InternetAddress from = new InternetAddress(emailfrom);
msg.setFrom(from);
InternetAddress[] address =
new InternetAddress(emailto)
//InternetAddress ad=new InternetAddress(session);
msg.setRecipients(Message.RecipientType.TO, address);
System.out.println("fc");
msg.setSubject(msgSubject);
System.out.println("fvf");
if(!sendmultipart)
// send a plain text message
msg.setContent(msgText, "text/plain");
System.out.println("fif");
else
System.out.println("felsd");
// send a multipart message// create and fill the first message part
MimeBodyPart mbp1 = new MimeBodyPart();
mbp1.setContent(msgText, "text/plain");
// create and fill the second message part
MimeBodyPart mbp2 = new MimeBodyPart();
mbp2.setContent(msgText2, "text/plain");
// create the Multipart and its parts to it
Multipart mp = new MimeMultipart();
mp.addBodyPart(mbp1);
mp.addBodyPart(mbp2);
// add the Multipart to the message
msg.setContent(mp);
Transport transport = session.getTransport("smtp");
transport.connect(smtphost,"[email protected]","xyz");
msg.saveChanges();
System.out.println("fconn");
//transport.sendMessage(msg,msg.getAllRecipients());
transport.sendMessage(msg,msg.getAllRecipients());
transport.close();
//Transport.send(msg);
catch(MessagingException mex)
mex.printStackTrace();
return "Email sent to " + emailto;
class SMTPAuthenticator extends Authenticator
public PasswordAuthentication getPasswordAuthentication()
String username = "[email protected]";
String password = "xyz";
return new PasswordAuthentication(username, password);
i dont understand what the problem is..inspite of having the right code..
i guess some firewall problem..
can somebody help me please..il be highly obliged..thanks.. -
How to use variables in the mail text while sending mails through workflows
Dear All,
I had prepared a workflow in which i am sending mail to a administrator if personnel data of any employee is changed.But i want to send the personnel no of employee whose data have been changed.How can i send this personnel no in the mail.
Points will be rewarded for useful answer.Hi Anand,
You have the "EmployeeNumber" field in the event container. Pass this into the workflow container by defining a Workflow Container element and subsequently use this container as a variable in your email using insert fields option and you will have the PersonNumber visible in your mail sent to the administrator.
Regards,
Karthik
Maybe you are looking for
-
HT4788 Has anyone esle found this no longer works after updating to 10.8.5?
The Policy Banner no longer seems to show up in 10.8.5, and I am wondering if the update is related to this. Has anyone else experienced the same thing?
-
Is it possible to open a Blurb BookSmart document with InDesign
I created a book [document] in Blurb's BookSmart and would like to know if it is possible to open it in InDesign and make minor modifications, and then save to PDF.
-
How to measure the InfoCube size?
can any body help me regarding this how to measure the info cube size?
-
Aperture imports, and RAW files...
After I import raw photos into Aperture when I first click on the photo and it opens in full screen, it looks brighter/best and then a second later the photo darkens colors change just a little, almost like I have an import preset assigned and it onl
-
Palm Desktop software - Fails to open with msg "Error: Failed to open Address Book database"
In July 2009 I dropped my trusty Visor on a tile floor and it stopped working. So, in the meantime I have been using only the Palm Desktop software. Just yesterday, when I attempted to launch the Palm Desktop software, it failed with the message “E