Send mail (Urgent)

HI guys,
Please look at the coding below..
l_wa_recieve-receiver = '[email protected]'. " this is the distribution list id "with number of mail ids inside it
l_wa_recieve-rec_type = 'C'. "shared dis list
APPEND l_wa_recieve TO l_it_recieve.
CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
EXPORTING
document_data = "ERROR'
document_type = 'DLI'
put_in_outbox = c_x
commit_work = c_x
TABLES
object_content = l_it_content "this table contains the body of email
receivers = l_it_recieve " this is above
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
Can you just tell me whether it works fine.. And if it is correct how much time will it take to get email in my respective email address..
I have run this FM by just giving my mail id (not distribution list just giving doctype = 'RAW instead of DLI)
The FM ran sucessfully without any errors , But I didnot receive any mail in my mail Inbox..
Can you please help me how to sort it out getting mail in less time..
Points will be rewarded
regards,
nazeer

Hi Nazeer,
               This will work fine.but If u are not getting mail just go through this documentation.This will help u find out the error.
Functionality
This function module enables you to send a new document, which has not yet been created, internally and externally. During the send process the document is created, along with the attributes and content that are to be transferred.
Import parameters
DOCUMENT_TYPE
Default = 'RAW'.
Document class. All classes are possible except for folders ('FOL') and distributions lists ('DLI').
PUT_IN_OUTBOX
Default = ' '.
If this flag is activated ('X'), the newly created document is also placed in the outbox of the active user when it is sent.
DOCUMENT_DATA
This structure must contain the attributes of the document to be sent.
OBJ_NAME
Name of document.
OBJ_DESCR
Title (short description) of document.
OBJ_LANGU
Language of document.
OBJ_SORT
Sort field of document. You can search for this term using attribute search.
OBJ_EXPDAT
Expiry date of document. The document itself cannot expire, but each time the document is entered in a folder, this date is used as the default for the expiry date of the entry (field EXPIRY_DAT).
SENSITIVTY
Document sensitivity.
A private document can have the following levels of sensitivity:
'O' : Standard, normal sensitivity
'F' : Functional, can be forwarded functionally
'P' : Confidential, not visible to substitutes
For documents in shared folders, only sensitivity level 'O' is permitted.
OBJ_PRIO
Recipient priority. The document itself does not have a priority level, but each time the document is entered in a folder, this value is used as the default for recipient priority for the entry (field PRIORITY).
NO_CHANGE
If this flag is activated ('X'), documents in shared folders can only be changed by the author. The author can change documents in private folders after they have been sent.
PRIORITY
Recipient priority for the folder entry. This value gives the priority, which was assigned to the document by the owner, after receipt.
EXPIRY_DAT
Expiry date of the folder entry. When the expiry date has been reached or passed, the entry is placed in private trash and can be retrieved from there if needed, up until the next time the trash is emptied. A new folder entry is initially given the expiry date of the document from field OBJ_EXPDT.
PROC_TYPE
If this field does not contain the default value (default is ' '), the document can be processed.
The following entries are permitted:
'D' : Dialog module
'F' : Function module
'R' : Report
'S' : Report with transfer of values to global memory
'T' : Transaction
'U' : Transaction with transfer of values to global memory
PROC_NAME
Processing element. You must enter the name of the dialog module, function module, report or transaction in accordance with the entry in the field PROC_TYPE.
PROC_SYST
Name of sytem in which the document is to be processed. If no system is specified or '*' is entered, processing is possible in all systems.
PROC_CLINT
Client in which the document is to be processed. If no client is specified or '*' is entered, processing is possible in all clients.
SKIP_SCREN
If this flag is activated ('X'), the first screen is skipped during processing.
TO_DO_OUT
If this flag is activated ('X'), the document cannot be processed from the SAPoffice interface. You must use the API function module SO_DOCUMENT_SET_STATUS_API1.
FREE_DEL
If this flag is activated ('X'), you can delete the document from external folders using the API.
DOC_SIZE
Size of the document in bytes. For PC documents, the size of the relevant file should be entered, for RAW  and SCR documents the size is the "length of the last line" + "number of other lines multiplied by 255".
Export parameters
NEW_OBJECT_ID
Object ID of the document created during the send process.
SENT_TO_ALL
If this flag is activated ('X'), the document was sent to all specified recipients or, in the case of external forwarding, the corresponding send requests were delivered to the subsystem. If sending or delivery failed in one or more cases, the flag is not activated.
Table parameters
OBJECT_HEADER
This table must contain the document class-relevant data. For example, SAPscript documents store information here about forms and styles, Excel list viewer documents store, amongst other things, the number of rows and columns and PC documents store their original file names.
LINE
Requires class-relevant document information line by line.
OBJECT_CONTENT
This table must contain the actual content of the document.
LINE
Requires the content of the document line by line.
OBJECT_PARA
This table is used only by documents that are to be processed. It must contain the SET/GET parameter that is transferred to the processing element.
NAME
Name of the SET/GET parameter. Only the first three characters are used.
OPTION
This field is not used.
LOW
Requires the value of the parameter in NAME.
HIGH
This field is not used.
OBJECT_PARB
This table is only used by documents to which a particular processing type is assigned. The meaning of the table depends on the processing type. If the processing element is a report, or transaction with transfer of values to the global memory, the table content is interpreted as the quantity of parameters with the relevant values and exported to the memory ID taken from the first row. If the processing element is a function module or a dialog module, the table is transferred to this as table parameter MSGDIAL.
NAME
If the processing element is a report or a transaction with transfer of values to the global memory, the field of the first row of the table must contain the name of the memory ID used for the export. The fields of the other rows accommodate the parameter names. If the processing element is a function module or a dialog module, the fields must contain values corresponding to the use of the module.
VALUE
If the processing element is a report or a transaction with transfer of values to the global memory, the field for the first row of the table must remain empty. The fields for the other rows accommodate the values belonging to the parameters in NAME. If the processing element is a function or dialog module, the fields must contain values corresponding to the use of the modules.
RECEIVERS
This table must contain the document recipients.
RECEIVER
Name of recipient.
The following entry categories are possible:
SAP user name of the recipient
SAPoffice name of the recipient
Shared distribution list
Fax number in the form of structure SADRFD
Internet address in the form of structure SADRUD
Remote SAP name in the form of structure SADR7D
X.400 address in the form of structure SADR8D
ADR_TYPE
Type of RECEIVER entry.
The following values are permitted:
'B' : SAP user name
' ' : SAPoffice name
'C' : Shared distribution list
'F' : Fax number
'U' : Internet address
'R ' : Remote SAP name
'X' : X.400 address
REC_ID
If the recipient is a SAPoffice user, the user ID, instead of the recipient name in RECEIVER, can be entered in this field.
REPLY_DOC
If there is a value in this field, the document is a reply to the folder entry identified by the specified ID. A correspondence history is automatically created/continued.
REC_DATE
The date on which the document is to reach the recipient. This date cannot be guaranteed for external recipients as it depends on connected products.
PROXY_ID
If automatic forwarding is active in the recipient's system, this field contains the SAP user ID or the address ID of the external address to which the document was ultimately sent.
RETRN_CODE
When the recipient has received the document, the function module enters the value '0' in this field. If the document is not successfully received, a value unequal to '0' is entered in the field.
EXPRESS
If this flag is activated ('X'), the document is sent with the attribute 'express'. If the recipient is a SAPoffice user who is logged on, he or she receive a message immediately, saying that he or she has received an express mail.
COPY
If this flag is activated ('X'), the document is sent with the attribute 'copy'.
BLIND_COPY
If this flag is activated ('X'), the document is sent with the attribute 'secret copy'. If the recipient is a SAPoffice user, he or she can neither print nor forward the document.
NO_FORWARD
If this flag is activated ('X') and the recipient is a SAPoffice user, he or she cannot forward the document.
NO_PRINT
If this flag is activated ('X') and the recipient is a SAPoffice user, he or she cannot print the document.
TO_ANSWER
If this flag is activated ('X') and the recipient is a SAPoffice user, the user must reply to the document before he or she can delete it from his or her inbox.
TO_DO_EXPL
If this flag is activated ('X') and the recipient is a SAPoffice user, the user must process the document before he or she can delete it from his or her inbox.
TO_DO_GRP
If this field contains a value between '1' and '9', a SAPoffice user in the recipient group indicated by this number must process the document before the recipients can delete it from their inboxes. If the value '0' is entered, the document does not need to be processed.
COM_TYPE
Communication method used to send the document. This field is only relevant if the recipient is an address number, that is, if the document is sent externally via address management. If the field is empty, the standard communication type specified in address management is used.
The following values are permitted:
'INT' : Send via Internet
'FAX' : Send as a fax
'X40' : Send via X.400
'RML' : Send in another SAP system
LFDNR
Current number from address management. This field is only relevant if the recipient is an address number, that is, if the document is sent via address management. If the field is empty, the default current number in address management is used.
FAX
This field is not used.
COUNTRY
This field is not used.
SPOOL_ID
This field is not used.
NOTIF_DEL
If this flag is activated ('X'), the sender receives confirmation when the recipient receives the document. He or she also receives a message if the document could not be delivered. This flag should only be activated for external sending, since internal sending is synchronous. Confirmation is only supported by a small number of mail systems, however. For example: X.400 and SAP SAP.
NOTIF_READ
If this flag is activated ('X'), the sender is notified as soon as the recipient has read the document. This flag should only be activated for external sending, since internal sending is synchronous. Read notification is only supported by a small number of mail systems, however. For example: X.400 and SAP SAP.
NOTIF_NDEL
If this flag is activated ('X'), the recipient receives a message if the document could not be delivered to the recipient. This flag should only be activated for external sending, since internal sending is synchronous. The message is only supported by a small number of mail systems, however. For example: X.400 and SAP SAP.
SAP_BODY
If this flag is activated ('X'), SAP specific data is transferred to the document in an external body part when sending via X.400. This flag should only be activated if the target system is an SAP System.
Exceptions
TOO_MANY_RECEIVERS
Too many recipients were specified. The active user does not have authorization to send to this number of recipients.
DOCUMENT_NOT_SENT
The document could not be sent. It was not delivered to any of the specified recipients.
DOCUMENT_TYPE_NOT_EXIST
The document class specified does not exist or is not permitted.
OPERATION_NO_AUTHORIZATION
The document was not allowed to be sent because one of the required authorizations did not exist.
PARAMETER_ERROR
The combination of parameter values transferred to the function module was not a permitted combination.
X_ERROR
Am internal error or a database inconsistency has occurred.
ENQUEUE_ERROR
A lock required for the send process could not be set. It is probable that another user is processing.
Example
Sending a confidential RAW document to an internal user and an Internet address. The new document is also placed in the sender's outbox.
DATA: OBJCONT LIKE SOLISTI1 OCCURS 5 WITH HEADER LINE.
DATA: RECLIST LIKE SOMLRECI1 OCCURS 5 WITH HEADER LINE.
DATA: DOC_CHNG LIKE SODOCCHGI1.
DATA: ENTRIES LIKE SY-TABIX.
DATA: NAME(15).
Fill the document
DOC_CHNG-OBJ_NAME = 'URGENT'.
DOC_CHNG-OBJ_DESCR = 'Read at once !'.
DOC_CHNG-SENSITIVTY = 'P'.
OBJCONT = 'Hey guys, time for lunch !!!'.
APPEND OBJCONT.
OBJCONT = 'Lets get going !'.
APPEND OBJCONT.
DESCRIBE TABLE OBJCONT LINES ENTRIES.
READ TABLE OBJCONT INDEX ENTRIES.
DOC_CHNG-DOC_SIZE = ( ENTRIES - 1 ) * 255 + STRLEN( OBJCONT ).
Fill the receiver list
CLEAR RECLIST.
RECLIST-RECEIVER = SY-UNAME.  " replace with <login name>
RECLIST-REC_TYPE = 'B'.
RECLIST-EXPRESS = 'X'.
APPEND RECLIST.
CLEAR RECLIST.
RECLIST-RECEIVER = '[email protected]'.
RECLIST-REC_TYPE = 'U'.
APPEND RECLIST.
Send the document
CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
     EXPORTING
          DOCUMENT_TYPE  = 'RAW'
          DOCUMENT_DATA  = DOC_CHNG
          PUT_IN_OUTBOX  = 'X'
     TABLES
          OBJECT_CONTENT = OBJCONT
          RECEIVERS      = RECLIST
     EXCEPTIONS
          TOO_MANY_RECEIVERS         = 1
               DOCUMENT_NOT_SENT          = 2
              OPERATION_NO_AUTHORIZATION = 4
               OTHERS                     = 99.
    CASE SY-SUBRC.
      WHEN 0.
        LOOP AT RECLIST.
          IF RECLIST-RECEIVER = SPACE.
            NAME = RECLIST-REC_ID.
          ELSE.
            NAME = RECLIST-RECEIVER.
          ENDIF.
          IF RECLIST-RETRN_CODE = 0.
            WRITE: / NAME, ': succesfully sent'.
          ELSE.
            WRITE: / NAME, ': error occured'.
          ENDIF.
        ENDLOOP.
      WHEN 1.
        WRITE: / 'Too many receivers specified !'.
      WHEN 2.
        WRITE: / 'No receiver got the document !'.
      WHEN 4.
        WRITE: / 'Missing send authority !'.
      WHEN OTHERS.
        WRITE: / 'Unexpected error occurred !'.
    ENDCASE.
Notes
To send an existing document, you must use the function module SO_OLD_DOCUMENT_SEND_API1.
If the active user is still to be able to process the document after it has been sent, it must be moved to the outbox when sent using the flag PUT_IN_OUTBOX. You can use the function module SO_FOLDER_READ_API1 to read the contents of the outbox and the object ID to find the document sent.
It is not possible to use a user address name as the recipient since this may not be unique. To get around this problem, you can use the function module SO_NAME_CONVERT_API1. This provides a hit list in response to a specified name, for which a dialog is constructed with a choice of required values.
Parameters
DOCUMENT_DATA
DOCUMENT_TYPE
PUT_IN_OUTBOX
COMMIT_WORK
SENT_TO_ALL
NEW_OBJECT_ID
OBJECT_HEADER
OBJECT_CONTENT
CONTENTS_HEX
OBJECT_PARA
OBJECT_PARB
RECEIVERS
Exceptions
TOO_MANY_RECEIVERS
DOCUMENT_NOT_SENT
DOCUMENT_TYPE_NOT_EXIST
OPERATION_NO_AUTHORIZATION
PARAMETER_ERROR
X_ERROR
ENQUEUE_ERROR
U can use other FM also
<b>SO_DOCUMENT_SEND_API1
SO_NEW_DOCUMENT_ATT_SEND_API1
SO_OLD_DOCUMENT_SEND_API1</b>
Reward points if helpful.
Regards,
Hemant

Similar Messages

  • Sending mails (urgent!!!)

    Hi all!
    I�d like to send an email from inside the applet. For this reason I need to get the Systemproperties, don't I ?
    Properties props = System.getProperties();
    props.put("mail.smtp.host", mailhost);
    ... and set the mail.smtp.host Property my smtp-host.
    But as I try to get the systemproperties from the applet, I get the exception:
    com.ms.security.SecurityExceptionEx[Sendmsg.<init>]: Unable to access system properties.
    Can somebody tell me, how I can solve this problem? Which properties are needed to send mails?
    Does it work, if I just create my Properties, and set only the smtp.host?
    Pleeaaaase help, I have to hand in my project very soon!
    Thanks a lot,
    Gabor

    You're not allowed to set properties from an unsecure applet. Your applet is unsecure because it isn't signed. Therefore sign your applet.

  • Sending mail but displaying the uncode in subject filed...some wht urgent

    Hi every one
    and Thanx to every one...for giving their precious help for every one
    Here i want to explain a small problem in java mail with unicode
    Here it is ....
    Iam sending a mail with some chinese characters in the subject field..internally these chineese characters are converting in to html unicode format like(&#20027;).
    the code goes like this :
    MimeMessage message =new MimeMesage();
    String subject=&#20027;&#30340;&#30005;
    message.setSubject(subject,"utf-8");
    ......remaining are setted properly i mean from ,to using InternetAddress
    Multipart multipart = new MimeMultipart();
    BodyPart messageBodyPart = new MimeBodyPart();
    messageBodyPart.setContent(content, "text/html");
    multipart.addBodyPart(messageBodyPart);
    message.setContent(multipart);
    Transport.send(message);
    Now
    It is sending mail to the receipents but in at the receiver side the mail's subject field contains unicode in stead of chinese characters....if i open and seen the viewsource from the page it is adding an extra &amp instead of &..i think it is not filtering th unicode ....here iam sending the mail to gmail...
    I didn't understand where iam doing the mistake please give some idea how to do this .....and let know where iam doing worng programming ....
    it s very urgent for me ...please
    Thanx in advance ......
    Srikanth

    hi bshannon
    i solved this problem .....i will explain what did here
    here iam getting the string literal from the DB as NCR formated string
    so i converted that string to unicode string ...(Ex: "&amp#220027;")
    This method will converts the NCR fomated string to UnicodeString:
    public static String NCR2UnicodeString(String str)
    StringBuffer ostr = new StringBuffer();
    int i1=0;
    int i2=0;
    while(i2<str.length())
    i1 = str.indexOf("&#",i2);
    if (i1 == -1 ) {
    ostr.append(str.substring(i2, str.length()));
    break ;
    ostr.append(str.substring(i2, i1));
    i2 = str.indexOf(";", i1);
    if (i2 == -1 ) {
    ostr.append(str.substring(i1, str.length()));
    break ;
    String tok = str.substring(i1+2, i2);
    try {
    int radix = 10 ;
    if (tok.trim().charAt(0) == 'x') {
    radix = 16 ;
    tok = tok.substring(1,tok.length());
    ostr.append((char) Integer.parseInt(tok, radix));
    } catch (NumberFormatException exp) {
    ostr.append('?') ;
    i2++ ;
    return new String(ostr) ;
    from this method i will get a string the unicode ...and iam setting this string to subject
    MimeMessage message =new MimeMessage();
    message.setSubject("string from the above method","utf-8");
    and remaing setting all are doing here
    finally
    Transport.send(message);
    I hope you are also expained the same thing ...
    and a lot thanx to you to solve my urgent problem...
    Thanx
    Srikanth

  • Problem in sending mail from REPORT BUILDER...HELP ...PLS ....URGENT

    Hi All,
    I added the mailserver part in the rwbuilder.conf file.This is how it looks
    <pluginParam name="mailServer">smtp.xxx.com</pluginParam>
    The smtp server of our company is working fine.
    Now when i am sending mail frm report builder i am getting the error.
    Pls tell me .....
    Do i have to configure any other file?
    Should the smtp server be running in my local machine?WHAT IS THE SOLUTION ...FOR THIS PROBLEM?
    Please someone give me some guidance..
    regards,
    ashok

    Hi,
    Pls give some idea ......
    your reply will be greatly appreciated.
    regards,
    ashok

  • Send Link of Display Purchase order in notification mail(Urgent)

    Hi Friends,
    When ever a PO is Approved, a notification mail is supposed to be send & in that mail ...the link of Display PO is to be added..
    Please help out in detail .....
    Thanks,
    Kartikey Rawat.

    Hi,
    If you are using Send Mail step associated with SELFITEM.SENDTASKDESCRIPTION to send mail from your workflow, to send attachments you need to do the following bindings to your send mail step.
    <your attachment object> -> &_Attach_Objects&
    <your attachment object> -> &Attachments&
    However, before this you should have your attachment as SOFM Object instance.

  • Very urgent: query regarding sending mail frm infopackage

    Hi all,
              At InfoPackage level at menubar in systems option--->short message option is exists.
           Can we use this option to send mail to client that infopackage has been successful or failure.
            Please send me more detaily how can we send mail to any receipent.I am unable to work on this option please help me out.
    Thanks & Regards,
    Praveena

    Hi praveena,
    if you want to send messages when the infopackage is successful, this can be done in the process chains.
    Steps are as follows:
    create process chain to include the Infopackage (IP) for which you want to send
       message
    Right click on the IP , create message. pop up will come asking you when the 
       message should be sent seolect when it is successful
    Create variant for sending message and maintain the receipient list (email IDs)
    with this you can send messages.
    I hope this will help you.
    Vijay.

  • Sending Mail problem - Very Urgent

    I want to send mail through the Java code using struts framework.It works fine olny with the authentication.I want suggestions for sending mails without authentication.

    {color:red}CROSS POSTED{color}
    {color:0000ff}http://forum.java.sun.com/thread.jspa?threadID=5245789
    {color}
    Cross posting is rude.
    And as I noted on the other thread, looks like a identity fraud requirement to me.
    db

  • 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
    sabu

    I 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.

  • Urgent: How to overcome the send mail limitation

    I am trying to use htmldb_mail PL/SQL package to send mail to 400 people, but get following message:
    "."WWV_FLOW_MAIL_QUEUE"."MAIL_TO" (actual: 3551, maximum: 2000)
    How do I overcome the limitation?
    Any suggestions will be greatly appreaciated.

    Things that spring to mind -
    1) Setup a mailing list on a mailserver (if you're using one like Exchange, Sendmail, Postfix etc) and have your application email the mailing list. That way your app sends out 1 email, and the mail server takes care of expanding the address list to the 400 people (this is probably the most 'efficient' way to do it).
    2) Do your mailing in part (e.g. 100 people at a time), so you send out 4 emails with each one addressed to a batch of 100 people
    3) Use the CC list (I don't believe the CC list has the same limit, but I haven't checked).
    4) Send out the emails individually, e.g. one email per recipient...this is an absolutely horrendous way to do it however, the load on your mailserver will be hugely increased and your mail administrator will probably shout at you, however it's an option (I wouldn't do it this way, but it is an option). I repeat....I'm not advocating you do it this way.....

  • 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.

  • Receiving mail, but can't send mail with attachments?

    Hello,
    I can't send mails anymore, I have been able to send some without any attachments (i.e. reply doesn't work as it automatically attaches the original text). This started 3 days ago. Also, my mail doesn't seem to recognize powerpoint and word docs., but I a know the people who have send me such files do not have VISTA. When I choose "open with" then it works. So I have 2 problems, one being moe urgent then the other.
    1) can't send mail with attachments
    2) .doc (word), .pps (powerpoint)attachments are not always recognized.
    thank you all!!!

    Try going into Settings > Mail, Contacts, Calendars > select the account > account name , tap on SMTP (under the 'Outgoing Mail Server' heading) and then tap on your Primary Server and try entering your email account and password and see if it then works

  • Sending mail to internet ID

    Hi All,
    I am trying to send a mail to an external id from SAP.
    I am using the code given below. After executing the code i am getting mail in my sap mail box but not in external mail id.  Also I am not able to see the sent mail in tcode <b>SOST</b> .
    At the same time, if i am sending mail from <b>SO01</b> it is coming to <b>SOST</b> . From <b>SOST</b> if i am doing "start send process" (ie Ctrl+F7 ), I am able to get mail in external ID. How can I do it directly from the program? Please help me.
    DATA: WA_DOCUMENT_DATA  TYPE SODOCCHGI1.
    DATA: IT_OBJECT_CONTENT LIKE SOLISTI1 OCCURS 5 WITH HEADER LINE.
    DATA: IT_RECEIVER       LIKE SOMLRECI1 OCCURS 5 WITH HEADER LINE.
    DATA: ENTRIES LIKE SY-TABIX.
    DATA: NAME(20).
    Fill the document
    WA_DOCUMENT_DATA-OBJ_NAME = 'URGENT'.
    WA_DOCUMENT_DATA-OBJ_DESCR = 'Notification !'.
    WA_DOCUMENT_DATA-SENSITIVTY = 'P'.
    WA_DOCUMENT_DATA-OBJ_LANGU  = SY-LANGU.
    IT_OBJECT_CONTENT = 'Hey this is test message !!!'.
    APPEND IT_OBJECT_CONTENT.
    IT_OBJECT_CONTENT = 'Please reply !'.
    APPEND IT_OBJECT_CONTENT.
    DESCRIBE TABLE IT_OBJECT_CONTENT LINES ENTRIES.
    READ TABLE IT_OBJECT_CONTENT INDEX ENTRIES.
    WA_DOCUMENT_DATA-DOC_SIZE = ( ENTRIES - 1 ) * 255 + STRLEN( IT_OBJECT_CONTENT ).
    Fill the receiver list
    CLEAR IT_RECEIVER.
    IT_RECEIVER-RECEIVER = SY-UNAME.
    IT_RECEIVER-REC_TYPE = 'B'.
    IT_RECEIVER-EXPRESS = 'X'.
    APPEND IT_RECEIVER.
    CLEAR IT_RECEIVER.
    IT_RECEIVER-RECEIVER = '[email protected]'.
    IT_RECEIVER-REC_TYPE = 'U'.
    IT_RECEIVER-EXPRESS = 'X'.
    APPEND IT_RECEIVER.
    CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
      EXPORTING
        DOCUMENT_DATA                    = WA_DOCUMENT_DATA
       DOCUMENT_TYPE                    = 'RAW'
       PUT_IN_OUTBOX                    = ' '
      COMMIT_WORK                      = ' '
    IMPORTING
      SENT_TO_ALL                      =
      NEW_OBJECT_ID                    =
      TABLES
      OBJECT_HEADER                    =
       OBJECT_CONTENT                   = IT_OBJECT_CONTENT
      CONTENTS_HEX                     =
      OBJECT_PARA                      =
      OBJECT_PARB                      =
        RECEIVERS                        = IT_RECEIVER
    EXCEPTIONS
       TOO_MANY_RECEIVERS               = 1
       DOCUMENT_NOT_SENT                = 2
       DOCUMENT_TYPE_NOT_EXIST          = 3
       OPERATION_NO_AUTHORIZATION       = 4
       PARAMETER_ERROR                  = 5
       X_ERROR                          = 6
       ENQUEUE_ERROR                    = 7
       OTHERS                           = 8
    IF SY-SUBRC <> 0.
      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Thanks in advance
    jaison

    Hai
    Go through the following Code
    DATA: OBJPACK LIKE SOPCKLSTI1 OCCURS 2 WITH HEADER LINE.
    DATA: OBJHEAD LIKE SOLISTI1 OCCURS 1 WITH HEADER LINE.
    DATA: OBJBIN LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
    DATA: OBJTXT LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
    DATA: RECLIST LIKE SOMLRECI1 OCCURS 5 WITH HEADER LINE.
    DATA: DOC_CHNG LIKE SODOCCHGI1.
    DOC_CHNG-OBJ_NAME = 'TEST'.
    DOC_CHNG-OBJ_DESCR = 'Test-Dokument fur API1 Test'(001).
    OBJTXT = 'Mindestgebot : $250000'.
    APPEND OBJTXT.
    OBJTXT = 'Eine Abbildung des zur Versteigerung stehenden Bildes'.
    APPEND OBJTXT.
    OBJTXT = 'wurde als Anlage beigefugt.'.
    APPEND OBJTXT.
    DESCRIBE TABLE OBJTXT LINES TAB_LINES.
    READ TABLE OBJTXT INDEX TAB_LINES.
    DOC_CHNG-DOC_SIZE = ( TAB_LINES - 1 ) * 255 + STRLEN( OBJTXT ).
    * ERSTELLEN DES EINTRAGS ZUM KOMPRIMIERTEN DOKUMENT
    CLEAR OBJPACK-TRANSF_BIN.
    OBJPACK-HEAD_START = 1.
    OBJPACK-HEAD_NUM = 0.
    OBJPACK-BODY_START = 1.
    OBJPACK-BODY_NUM = TAB_LINES.
    OBJPACK-DOC_TYPE = 'RAW'.
    APPEND OBJPACK.
    * ERSTELLEN DER ANLAGE FUR DAS DOKUMENT
    OBJBIN = '\O/ '. APPEND OBJBIN.
    OBJBIN = ' '. APPEND OBJBIN.
    OBJBIN = ' / \ '. APPEND OBJBIN.
    DESCRIBE TABLE OBJBIN LINES TAB_LINES.
    OBJHEAD = 'picasso.txt'. APPEND OBJHEAD.
    * Erstellen des Eintrags zur komprimierten Anlage
    OBJPACK-TRANSF_BIN = 'X'.
    OBJPACK-HEAD_START = 1.
    OBJPACK-HEAD_NUM = 1.
    OBJPACK-BODY_START = 1.
    OBJPACK-BODY_NUM = TAB_LINES.
    OBJPACK-DOC_TYPE = 'TXT'.
    OBJPACK-OBJ_NAME = 'ANLAGE'.
    OBJPACK-OBJ_DESCR = 'Abbildung Objekt 138'.
    OBJPACK-DOC_SIZE = TAB_LINES * 255.
    APPEND OBJPACK.
    * Fullen der Empfangerliste
    RECLIST-RECEIVER = SY-UNAME.
    RECLIST-REC_TYPE = 'B'.
    APPEND RECLIST.
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    EXPORTING
    DOCUMENT_DATA = DOC_CHNG
    PUT_IN_OUTBOX = 'X'
    TABLES
    PACKING_LIST = OBJPACK
    OBJECT_HEADER = OBJHEAD
    CONTENTS_BIN = OBJBIN
    CONTENTS_TXT = OBJTXT
    RECEIVERS = RECLIST
    EXCEPTIONS
    TOO_MANY_RECEIVERS = 1
    DOCUMENT_NOT_SENT = 2
    OPERATION_NO_AUTHORIZATION = 4
    OTHERS = 99.
    Regards
    Sreeni

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

    Hi,
    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 TO POSITIONS THROUGH SEND MAIL STEP

    Hi Experts,
    I am facing some problems in sending mail to positions from the organization structure from the send mail step.When I am using user as the recipient type it is working fine...but when i am choosing S position as the recipient type it is giving the error in the workflow log stating that method SENDTASKDESCRIPTION cannot be executed.
    I need to find a solution urgently...any suggestion would be sincerely appreciated.
    thanks.
    Narsingh

    Well you have probably tried this.. but just a recheck.
    1 . send email setep select Organizational Object
    2. Recipient Type Organizational Unit
    3. Here do an F4 and then select the Unit...
    Try this SAP behaves weirdly at times...
    after this do Refresh Buffers.. and Org Unit...
    Let us know if this works

  • Can u send an URGENT text message on the Droid Charge???

    I been trying to figure out how to send an urgent text message. I've had the phone since lst November and seems all I can do is send regualr text messages. How can u send an urgent text message so that it grabs the recipients attention to respond as soon as possible. Like for example, that person ur sending the message to is in a situation where they cant recieve phone calls, so u gotta text them instead and its an urgent matter, so ur wanna to send an urgent text message that grabd their attention immediately.  So does anyone know how u go about sending an urgent text message? Please get back to me. Thanks -Brian

    don't know aside from calling someone.  if they are unable to receive phone calls, then they are probably unable to receive texts.  you could sending them an e-mail - perhaps they have a data signal?

Maybe you are looking for

  • How to upload data from excel to SAP using VB script or Macros

    Hi Guys, I want to make a macro enabled Excel sheet which  i can use to upload huge data on SAP . I read some discussion but didnt get anything. Please help me with a step by step document.

  • Limit Audio Output from AirPort Express

    I have active loudspeakers (B&O) that I'd like to drive with the airport express station. As I can not adjust the volume of the loudspeakers, I'd like to know, whether there is a possibility to regulate the output of the audio signal within the expre

  • CC2014 mp4/h.264 file error

    Just updated to CC2014 and now premiere can not play any mp4/h.264 file only showing a green image. Even if you export a working clip thats a different format from premiere as h.264 and import it back in, it will only show up green. Media Encoder 201

  • Outbound Delivery Idoc and Delivery Date

    Hi, Could anyone advice  if the idoc DELVRY01 is appropriate for outbound call? Also which segment stores the delivery date (LFDAT) details?

  • Two tab pages

    I have two tab canvas canvas_tab and canvas_mod with two tab pages . At when-tab-page-changed trigger code is DECLARE      tp_nm VARCHAR2(30);      tp_id TAB_PAGE;      tp_lb VARCHAR2(30); BEGIN      tp_nm := GET_CANVAS_PROPERTY('canvas_tab', topmost