Error while sending mail in RDI Format

Hi All
I have a requirement automate sending of invoices customers via fax and e-mail in RDI format.
For this I created a from and used the parameter raw_data_interface = 'X' for this and for sending mail filled the parameters MAIL_SENDER and MAIL_RECIPIENT for sending a mail, used device as 'MAIL'.
When I run the program i get the error "No Output Device Defined". Could you please tell where the issue is.
Best Regards,
Pradeep.

hi,
i am having one prob...
how to send a alv report to external mail id....like gmail,yahoo etc....
can u send me the code..
Pls........

Similar Messages

  • Error while sending mail from SAP

    Hello All,
    Recently we are facing an error while sending mail from SAP. When we try to compose a message ,it is moving to a dump error RAISE_EXCEPTION.
    The details from ST22,
    Short text
        Exception condition "FOLDER_NOT_EXIST" raised.
    Error analysis
        A RAISE statement in the program "SA
        condition "FOLDER_NOT_EXIST".
        Since the exception was not intercep
        program, processing was terminated.
    Kindly suggest..
    Thank You,
    Regards,
    Hasan

    Hello Priyanka,
    Actually, I performed the following two steps in order to solve the issue:
    - In transaction SICF, the node for SAPConnect must be active. In our system, this node was in inactive state. Hence I activated it.
    - Then In transaction SCOT-> Settings menu--> default domain should be 'xyz.com' if the email addresses in your company are maintained with a suffix  xyz.com.
    But for me the problem didnt get solved here..
    The problem that i am facing now is that if in my user profile, I have the email address maintained, then i get an error saying 'Sender address rejected'. However, if i goto transaction SU01 and clear the email id, the mail is successfully sent to outer world.
    You can try the above mentioned two steps using SICF and SCOT. If the problem does not get solved then try clearing the mail id in ur user profile.
    Hope this helps. If you find an answer to the problem of the mail id getting cleared, then please let me know..
    Regards,
    Himanshu

  • Urgent:-REP-50152: Error while sending mail

    hi
    i am using reports10g. i have called a report from a form and destype=mail.
    i have already mention the smtp server name in conf. file but still receiving this error
    REP-50152: Error while sending mail - Sending failed; nested exception is: javax.mail.SendFailedException: Invalid Addresses; nested exception is: javax.mail.SendFailedException: 550 5.7.1 Unable to relay for [email protected]
    thanks

    Your smtp server forbids relaying, which is very common. Often a smtp server is configured to send only mails within the same domain without authentication. Otherwise, you need a username and password for the smtp server. I'm not sure if you can configure Reports to send mail through an authenticated server.

  • Terminated with error: REP-50152:Error while sending mail

    Hi
    Gets this error while sending report mails to external email id's
    Terminated with error: REP-50152: Error while sending mail - Sending failed; nested exception is: javax.mail.SendFailedException: Invalid Addresses; nested exception is: javax.mail.SendFailedException: 550 5.7.1 Unable to relay for [email protected]
    Any setting to be done in report config file?
    thanks
    MG

    It should be like this
    <pluginParam name="mailServer">%MAILSERVER_NAME%</pluginParam>
    Specify the name of your mail server in the place of %MAILSERVER_NAME% above
    Also make sure that this is not commented out.
    Thanks,

  • Error While sending mail

    Working with 9.1.0.1
    I have created a task which will send Mail to user when password is changed.
    so in Notification Tab i Have clicked user check box and attached a appropiate Email Defination,
    when task is triggered password is changed in OID but while sending mail i am getting below error.
    I checked in metalink its shows when Email Server IT Res Name should be same as that configured in System property ,i checked both are same.
    1 Dec 2011 18:06:54,735,[XELLERATE.REQUESTS],Class/Method: tcEmailNotificationUtil/sendEmail encounter some problems: {1}
    lang.NullPointerException
    at java.util.Hashtable.put(Hashtable.java:394)
    at com.thortech.xl.dataobj.util.tcEmailNotificationUtil.sendEmail(Unknown Source)
    at com.thortech.xl.dataobj.tcScheduleItem.checkForEmailNotification(Unknown Source)
    at com.thortech.xl.dataobj.tcScheduleItem.eventPostUpdate(Unknown Source)
    at com.thortech.xl.dataobj.tcDataObj.update(Unknown Source)
    at com.thortech.xl.dataobj.tcDataObj.save(Unknown Source)
    at com.thortech.xl.adapterfactory.events.tcAdpEvent.updateSchItem(Unknown Source)
    at com.thortech.xl.adapterfactory.events.tcAdpEvent.finalizeProcessAdapter(Unknown Source)
    at com.thortech.xl.adapterfactory.events.tcAdpEvent.finalizeAdapter(Unknown Source)
    at com.thortech.xl.adapterGlue.ScheduleItemEvents.adpOIDMODIFYUSER.implementation(adpOIDMODIFYUSER.java:81)
    at com.thortech.xl.client.events.tcBaseEvent.run(Unknown Source)
    at com.thortech.xl.dataobj.tcDataObj.runEvent(Unknown Source)
    at com.thortech.xl.dataobj.tcScheduleItem.runMilestoneEvent(Unknown Source)
    at com.thortech.xl.dataobj.tcScheduleItem.eventPostInsert(Unknown Source)
    at com.thortech.xl.dataobj.tcDataObj.insert(Unknown Source)
    at com.thortech.xl.dataobj.tcDataObj.save(Unknown Source)
    at com.thortech.xl.client.events.tcTriggerUserProcesses.insertMileStones(Unknown Source)
    at com.thortech.xl.client.events.tcTriggerUserProcesses.trigger(Unknown Source)
    at com.thortech.xl.client.events.tcUSRTriggerUserProcesses.implementation(Unknown Source)
    at com.thortech.xl.client.events.tcBaseEvent.run(Unknown Source)
    at com.thortech.xl.dataobj.tcDataObj.runEvent(Unknown Source)
    at com.thortech.xl.dataobj.tcDataObj.eventPostUpdate(Unknown Source)
    at com.thortech.xl.dataobj.tcUSR.eventPostUpdate(Unknown Source)
    at com.thortech.xl.dataobj.tcDataObj.update(Unknown Source)
    at com.thortech.xl.dataobj.tcDataObj.save(Unknown Source)
    at com.thortech.xl.dataobj.tcTableDataObj.save(Unknown Source)
    at com.thortech.xl.ejb.beansimpl.tcUserOperationsBean.updateUserData(Unknown Source)
    at com.thortech.xl.ejb.beansimpl.tcUserOperationsBean.updateUser(Unknown Source)
    at com.thortech.xl.ejb.beans.tcUserOperationsSession.updateUser(Unknown Source)
    at com.thortech.xl.ejb.beans.tcUserOperations_voj9p2_EOImpl.updateUser(tcUserOperations_voj9p2_EOImpl.java:1763)
    at Thor.API.Operations.tcUserOperationsClient.updateUser(Unknown Source)
    at sun.reflect.GeneratedMethodAccessor485.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)

    Create a task "Send Email" which will be called on SUCCESS of Change Password Task
    Attach tcComplete in INTEGRATION tab And send Email from "Send Email" using Notification Tab
    It seems that issue is with Change Password Task
    Or Use APIs
    Re: Send Mail via java code but using Mail Definitions

  • Error while sending mail from SAP system

    Hi all,
    I configured SAP connect  in ecc6.0 ehp7 while sending mail using tx sost i am error
    Message cannot be transferred to node SMTP due to connection error (final) , below is the icm log.
    ERROR => IcmPlAllocBuf: MpiGetOutbuf failed (rc = 14(MPI_ESTALE: outdated MPI handle)) [icxxplugin.c 1222]
    ERROR => SMTP SmtpClientClose: alloc failed, rc = -3 [smtp_plg.c   3738]
    ERROR => IcmBufFree(id=0/32): MpiFreeBuf failed (rc=14), MPI_ESTALE: outdated MPI handle [icxxplugin.c 165
    ERROR => IcmConnClose: PlugInStopConn failed (rc=701) [icxxconn.c   3433]
    can any one please help on this
    Thanks,
    Narendar.

    Hello Priyanka,
    Actually, I performed the following two steps in order to solve the issue:
    - In transaction SICF, the node for SAPConnect must be active. In our system, this node was in inactive state. Hence I activated it.
    - Then In transaction SCOT-> Settings menu--> default domain should be 'xyz.com' if the email addresses in your company are maintained with a suffix  xyz.com.
    But for me the problem didnt get solved here..
    The problem that i am facing now is that if in my user profile, I have the email address maintained, then i get an error saying 'Sender address rejected'. However, if i goto transaction SU01 and clear the email id, the mail is successfully sent to outer world.
    You can try the above mentioned two steps using SICF and SCOT. If the problem does not get solved then try clearing the mail id in ur user profile.
    Hope this helps. If you find an answer to the problem of the mail id getting cleared, then please let me know..
    Regards,
    Himanshu

  • Error while sending mail tru campaign

    I have serious problem while sending mail thru a campaign in WebLogic 8.1.4 Portal. While running the application and visiting a portlet which contains the PlaceHolder which in turn is supposed to execute the campaign, the console
    shows an unending exception stack trace. The Exception is : "Exception:SQL Exception creating bucket entry ... transaction rolledback".
    Please help
    Thanks in advance
    Muhammed Shakir

    Turn on session debugging and examine the protocol trace. If you still can't figure it out,
    post the debug output here.
    Most likely you have a firewall or antivirus product that's closing the connection unexpectedly.
    Possibly your server is disconnecting for some reason. The protocol trace might provide clues.

  • 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,
    Sam

    Hi 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

  • Error while sending mail using script task in ssis 2008

    Hi,
        i am trying to send mail using ssis 2008 script task.for my requirement i am not able to use send mail task.
    code i have used is
    declared read only variables system::packagename
     Dim PACKAGE As String
            PACKAGE = Dts.Variables("System::PackageName").Value.ToString()
            Dim myHtmlMessage As MailMessage
            Dim mySmtpClient As SmtpClient
            myHtmlMessage = New MailMessage("[email protected]", "[email protected]", "PACKAGE STATUS", PACKAGE + "WAS FAILED")
         mySmtpClient = New SmtpClient("smtp.gmail.com")
            mySmtpClient.Credentials = New NetworkCredential("[email protected]", "mypassword")
            mySmtpClient.EnableSsl = True
            mySmtpClient.Port = 587
            mySmtpClient.Send(myHtmlMessage)
    error i am getting is
    Error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Net.Mail.SmtpException: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1
    Authentication Required. Learn more at
       at System.Net.Mail.MailCommand.CheckResponse(SmtpStatusCode statusCode, String response)
       at System.Net.Mail.MailCommand.Send(SmtpConnection conn, Byte[] command, String from)
       at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, SmtpFailedRecipientException& exception)
       at System.Net.Mail.SmtpClient.Send(MailMessage message)
       at ST_c121e07caaa94c21bb1355d4f753112f.vbproj.ScriptMain.Main()
       --- End of inner exception stack trace ---
       at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
       at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
       at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
       at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, CultureInfo culture)
       at Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine.ExecuteScript()
    can any one tell me where i am going wrong

    also getting error as follows
    Error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Net.Mail.SmtpException: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1
    Authentication Required. Learn more at
       at System.Net.Mail.MailCommand.CheckResponse(SmtpStatusCode statusCode, String response)
       at System.Net.Mail.MailCommand.Send(SmtpConnection conn, Byte[] command, String from)
       at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, SmtpFailedRecipientException& exception)
       at System.Net.Mail.SmtpClient.Send(MailMessage message)
       at ST_c121e07caaa94c21bb1355d4f753112f.vbproj.ScriptMain.Main()
       --- End of inner exception stack trace ---
       at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
       at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
       at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
       at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, CultureInfo culture)
       at Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine.ExecuteScript()

  • Error while sending mail to external id

    Hai all,
    I am trying to send mail to external mail id using the FM SO_NEW_DOCUMENT_ATT_SEND_API1. After executing when i check in sost i m getting an error 'Cannot process message, no route from sapuserto external mail id.
    Can anyone help me resolve this issue pls.
    Thanks in advance,
    Neela

    Hi,
    You have to fill the tables parameter 'PACKING_LIST'.
    try with these values
    wa_objpack-TRANSF_BIN = space.
    wa_objpack-HEAD_START = 1.
    wa_objpack-HEAD_NUM   = 0.
    wa_objpack-BODY_START = 1.
    wa_objpack-DOC_TYPE   = 'RAW'.
    APPEND wa_objpack to it_objpack.
    Regards,
    Daz.

  • Error while sending mail from SAP to external mail id

    Hello Experts,
    I am blocked by the below problem.
    I am trying to send email from SAP to an external email ID. I have tried using Class approach as well as the function 'SO_DOCUMENT_SEND_API1' for the same.
    Everytime i get the following message:
    Internal error: CL_SMTP_RESPONSE ESMTP error code is not known. 554 554 <email address> Sender address rejected.
    I am not at all able to figure out why this type of error is coming.
    The same code is working on the development environment but not on the test system.
    Please reply back asap as i am completely blocked due to this.
    Thanks/Regards,
    Himanshu

    Hello Priyanka,
    Actually, I performed the following two steps in order to solve the issue:
    - In transaction SICF, the node for SAPConnect must be active. In our system, this node was in inactive state. Hence I activated it.
    - Then In transaction SCOT-> Settings menu--> default domain should be 'xyz.com' if the email addresses in your company are maintained with a suffix  xyz.com.
    But for me the problem didnt get solved here..
    The problem that i am facing now is that if in my user profile, I have the email address maintained, then i get an error saying 'Sender address rejected'. However, if i goto transaction SU01 and clear the email id, the mail is successfully sent to outer world.
    You can try the above mentioned two steps using SICF and SCOT. If the problem does not get solved then try clearing the mail id in ur user profile.
    Hope this helps. If you find an answer to the problem of the mail id getting cleared, then please let me know..
    Regards,
    Himanshu

  • Error while sending mail with pdf attachment

    Dear All,
    I am sending mail to outlook Internet address, with PDF attachment, if i have the some text in the mail along with the attachment,
    then the PDF attachment file is not opeining, throws file corrupted error.
    If i don't have the text for mail body, and send only attachment then the PDF attachments working fine.
    Please help.
    regards,
    Kumar.

    Hi Kumar,
    If you are using the th FM "SO_NEW_DOCUMENT_ATT_SEND_API1" to send the PDF data(As an attachment) to an internet address, try prepare an internal table with the text you want to mention in your mail. This table needs to be passed to the
    'contents_txt' of this function module.  You can check your mail in SOST transaction and in DOC Content section.
      Ex:  wa_objtxt           = 'Regards'.
             APPEND wa_objtxt TO t_objtxt.
    I am sure that you won't get any problem if you follow the procedure mentioned above.
    Thank You,
    Regards,
    Naresh.

  • SMICM error while sending mail using SMTP server

    Hi All,
    We are not able send mails using SMTP server.
    We have made every settings necessary in SCOT, SO16 , SMTP service is activated, default domain is maintained etc
    Only things which seems to be wrong is in SMICM trace file.
    [Thr 13] *** ERROR => NiBufIConnect: non-buffered connect pending after 5000ms (hdl 29;10.26.24.44:1090) [nibuf.cpp    4608]
    [Thr 13] *** WARNING => Connection request from (0/1/0) to host: 10.26.24.44, service: 1090 failed (NIECONN_REFUSED)
    [icxxconn_mt.c 2321]
    This error is getting repeated in it.
    BUt I am not sure why it it trying to hit 10.26.24.44, as we dont have any server by this ip. The ip is only not resolvable from the server.
    1 more thing, at OS level, following parameter is maintained in profile :
    icm/server_port_1 = PROT=SMTP,PORT=25000,TIMEOUT=180
    But in SCOT, under SMTP node PORT is given as 25.
    Kindly let me know what going wrong here?
    Thanks

    also getting error as follows
    Error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Net.Mail.SmtpException: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1
    Authentication Required. Learn more at
       at System.Net.Mail.MailCommand.CheckResponse(SmtpStatusCode statusCode, String response)
       at System.Net.Mail.MailCommand.Send(SmtpConnection conn, Byte[] command, String from)
       at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, SmtpFailedRecipientException& exception)
       at System.Net.Mail.SmtpClient.Send(MailMessage message)
       at ST_c121e07caaa94c21bb1355d4f753112f.vbproj.ScriptMain.Main()
       --- End of inner exception stack trace ---
       at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
       at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
       at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
       at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, CultureInfo culture)
       at Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine.ExecuteScript()

  • Getting error while sending mail through javamail api

    I can able to compile the following code successfully but while executing it showing the error
    C:\Program Files\Java\javamail-1.4\demo>java msgsend -o [email protected] -M 203.112.158.188 [email protected]
    Exception in thread "main" java.lang.NoClassDefFoundError: msgsend
    import java.io.*;
    import java.net.InetAddress;
    import java.util.Properties;
    import java.util.Date;
    import javax.mail.*;
    import javax.mail.internet.*;
    public class msgsend {
    public static void main(String[] argv) {
         String to, subject = null, from = null,
              cc = null, bcc = null, url = null;
         String mailhost = "null";
         String mailer = "msgsend";
         String file = null;
         String protocol = null, host = null, user = null, password = null;
         String record = null;     // name of folder in which to record mail
         boolean debug = false;
         BufferedReader in =
                   new BufferedReader(new InputStreamReader(System.in));
         int optind;
         for (optind = 0; optind < argv.length; optind++) {
         if (argv[optind].equals("-T")) {
              protocol = argv[++optind];
         } else if (argv[optind].equals("-H")) {
              host = argv[++optind];
         } else if (argv[optind].equals("-U")) {
              user = argv[++optind];
         } else if (argv[optind].equals("-P")) {
              password = argv[++optind];
         } else if (argv[optind].equals("-M")) {
              mailhost = argv[++optind];
         } else if (argv[optind].equals("-f")) {
              record = argv[++optind];
         } else if (argv[optind].equals("-a")) {
              file = argv[++optind];
         } else if (argv[optind].equals("-s")) {
              subject = argv[++optind];
         } else if (argv[optind].equals("-o")) { // originator
              from = argv[++optind];
         } else if (argv[optind].equals("-c")) {
              cc = argv[++optind];
         } else if (argv[optind].equals("-b")) {
              bcc = argv[++optind];
         } else if (argv[optind].equals("-L")) {
              url = argv[++optind];
         } else if (argv[optind].equals("-d")) {
              debug = true;
         } else if (argv[optind].equals("--")) {
              optind++;
              break;
         } else if (argv[optind].startsWith("-")) {
              System.out.println(
    "Usage: msgsend [[-L store-url] | [-T prot] [-H host] [-U user] [-P passwd]]");
              System.out.println(
    "\t[-s subject] [-o from-address] [-c cc-addresses] [-b bcc-addresses]");
              System.out.println(
    "\t[-f record-mailbox] [-M transport-host] [-a attach-file] [-d] [address]");
              System.exit(1);
         } else {
              break;
         try {
         if (optind < argv.length) {
              // XXX - concatenate all remaining arguments
              to = argv[optind];
              System.out.println("To: " + to);
         } else {
              System.out.print("To: ");
              System.out.flush();
              to = in.readLine();
         if (subject == null) {
              System.out.print("Subject: ");
              System.out.flush();
              subject = in.readLine();
         } else {
              System.out.println("Subject: " + subject);
         Properties props = System.getProperties();
         // XXX - could use Session.getTransport() and Transport.connect()
         // XXX - assume we're using SMTP
         if (mailhost != null)
              props.put("mail.smtp.host", mailhost);
         // Get a Session object
         Session session = Session.getInstance(props, null);
         if (debug)
              session.setDebug(true);
         // construct the message
         Message msg = new MimeMessage(session);
         if (from != null)
              msg.setFrom(new InternetAddress(from));
         else
              msg.setFrom();
         msg.setRecipients(Message.RecipientType.TO,
                             InternetAddress.parse(to, false));
         if (cc != null)
              msg.setRecipients(Message.RecipientType.CC,
                             InternetAddress.parse(cc, false));
         if (bcc != null)
              msg.setRecipients(Message.RecipientType.BCC,
                             InternetAddress.parse(bcc, false));
         msg.setSubject(subject);
         String text = collect(in);
         if (file != null) {
              // Attach the specified file.
              // We need a multipart message to hold the attachment.
              MimeBodyPart mbp1 = new MimeBodyPart();
              mbp1.setText(text);
              MimeBodyPart mbp2 = new MimeBodyPart();
              mbp2.attachFile(file);
              MimeMultipart mp = new MimeMultipart();
              mp.addBodyPart(mbp1);
              mp.addBodyPart(mbp2);
              msg.setContent(mp);
         } else {
              // If the desired charset is known, you can use
              // setText(text, charset)
              msg.setText(text);
         msg.setHeader("X-Mailer", mailer);
         msg.setSentDate(new Date());
         // send the thing off
         Transport.send(msg);
         System.out.println("\nMail was sent successfully.");
         // Keep a copy, if requested.
         if (record != null) {
              // Get a Store object
              Store store = null;
              if (url != null) {
              URLName urln = new URLName(url);
              store = session.getStore(urln);
              store.connect();
              } else {
              if (protocol != null)          
                   store = session.getStore(protocol);
              else
                   store = session.getStore();
              // Connect
              if (host != null || user != null || password != null)
                   store.connect(host, user, password);
              else
                   store.connect();
              // Get record Folder. Create if it does not exist.
              Folder folder = store.getFolder(record);
              if (folder == null) {
              System.err.println("Can't get record folder.");
              System.exit(1);
              if (!folder.exists())
              folder.create(Folder.HOLDS_MESSAGES);
              Message[] msgs = new Message[1];
              msgs[0] = msg;
              folder.appendMessages(msgs);
              System.out.println("Mail was recorded successfully.");
         } catch (Exception e) {
         e.printStackTrace();
    public static String collect(BufferedReader in) throws IOException {
         String line;
         StringBuffer sb = new StringBuffer();
         while ((line = in.readLine()) != null) {
         sb.append(line);
         sb.append("\n");
         return sb.toString();
    So please help me to resolve that error.

    The directory that contains msgsend.class (usually the current directory)
    is not in your CLASSPATH setting. Be sure that "." is included as one of the
    entries in CLASSPATH.

  • Error while sending mail fromportal.

    Hi,
        I'am trying to Install and Configure Mail System in my portal.I had created a system and i had configured it.Whwn am trying to send Email from Collobaration launch pad link am getting this error
    "<b>The e-mail server could not be reached when the system was trying to send the message</b>"
    please help me in this issue.
    with regards
    Pradeep.B

    Hi,
    Check if the SMTP server configured r not.. if not refer this document
    http://help.sap.com/saphelp_nw04/helpdata/en/af/73563c1e734f0fe10000000a114084/frameset.htm
    configuring e-mail connectivity
    http://help.sap.com/saphelp_nw04/helpdata/en/5a/d089b338769f40a3a86ea938701c3f/frameset.htm
    Regards,
    Senthil K.

Maybe you are looking for