Information about arguments needed to send a mail

Hi,
I am very new to java mail. I am jus trying to send a mail using java mail. Can anyone please tell me wht are the command line arguments, tht i have to give in the following code.
import java.util.Properties;
import javax.mail.*;
import javax.mail.internet.*;
public class MailExample {
public static void main (String args[]) throws Exception {
String host = "args[0]";
String from = "args[1]";
String to = "args[2]";
final String username ="args[3]";
final String password = "args[4]";
// Get system properties
//Properties props = System.getProperties();
Properties props = new Properties();
// Setup mail server
props.put("mail.smtp.host", host);
props.put("mail.smtp.auth", "true");
// Get session
Session session = Session.getDefaultInstance(props,
          new javax.mail.Authenticator() {
          protected PasswordAuthentication getPasswordAuthentication() {
          return new PasswordAuthentication(username, password);
// Define message
MimeMessage message = new MimeMessage(session);
// Set the from address
message.setFrom(new InternetAddress(from));
// Set the to address
message.addRecipient(Message.RecipientType.TO,
new InternetAddress(to));
message.addRecipient(Message.RecipientType.CC,
new InternetAddress("[email protected]"));
message.addRecipient(Message.RecipientType.BCC,
new InternetAddress("[email protected]"));
message.addRecipient(Message.RecipientType.BCC,
new InternetAddress("[email protected]"));
// Set the subject
message.setSubject("Hello JavaMail");
// Set the content
message.setText("Welcome to JavaMail");
// Send message
Transport.send(message);
}

Hello,
You can send mail with the status of the test catalog-
specify a mail system to which Test Workbench test objects send messages to the people responsible
Please refer the below link for more information:
http://help.sap.com/saphelp_smehp1/helpdata/en/6a/88370a002911d2bd02080009b4534c/frameset.htm
Regards,

Similar Messages

  • While creating Purchase Requisition we need to send a mail for approvers

    Hi All,
    While creating Purchase requisition we need to send a mail to approvers.
    Dowe  need to create Function module ?
    if You know the steps can you please give me the steps.
    Thanks In advance
    Sriman.

    Hi Sriman
    Here we can try for 2 approach
    one is workflow and other his sending emails via user exit.
    I am not much aware about workflow, but you can explore for user exit.
    Try for enhancement component 'MEREQ001'.
    let me know, if you need further help
    Regards
    MD

  • Need to send a mail while safty stock goes down compare with actual stock

    Dear experts,
    I Need to send a mail to concern persion while stock goes down compare with safty stock. We plan to put a check at the point of MARD table updation, Because we not able to put a check at the all transaction codes, So please LET ME KNOW HOW TO PUT A CHECK AT STANDARD TABLE UPDATION?
    Thanks in adv,
    jayakumar.M

    Your best bet may to be place your check in the a user exit for goods movements.  The enhancement is MB_CF001, the component is EXIT_SAPLMBMB_001.
    Hope this helps,
    Mark

  • Need to send a mail while safty stock goes down

    Dear experts,
    I Need to send a mail to concern persion while stock goes down from safty stock. We plan to put a check at the point of MARD table updation, Because we not able to put a check at the all transaction codes, So please LET ME KNOW HOW TO PUT A CHECK AT STANDARD TABLE UPDATION?
    Thanks in adv,
    jayakumar.M

    Hi Jai,
    According to my understanding,
    As soon as the stock goes down from the safety stock a mail should be triggered.
    Probable solution (in my opinion)
    create a flag in the table set it whenever the stock value goes down.
    make calculations like (safety stock as today - safety stock previous date) = 0 if not set the flag and construct a workflow withe receiver settings based on the flag field and trigger a mail to the concerned person.
    This is just my idea.
    Try it and revert
    Thanks and Regards
    Srikanth.P

  • Any changes in PA30 need to send a mail to the Managers outlook inbox

    Hi,
    Any changes in PA30 (ESS) need to send a mail to the Managers outlook inbox  .
    Kindly let me know the Standard workflow template and  to built the Custom function module in Rule .
    Thanks in advance,
    Richard A

    <i>Any changes in PA30 (ESS) need to send a mail to the Managers outlook inbox</i>
    If its just an email do u need a workflow for it? Configure dynamic actions which will call a subroutine when a change is made to the infotype and send email from that subroutine using SO_NEW_DOCUMENT_SEND_API1.(you can include the necessary logic for determining the approver in the same subroutine).
    Thanks,
    Prasath N

  • Need an enhancement after releasing a PO Need to send a mail to vendor

    Hi all,
              I am having a requirement that, need to send a mail and attachment whenever a PO get released.
    Can anyone help to find the enhancement for to write the code to send a mail to vendor.
    Regards.
    Ranganadh.

    Hi,
    To send a mail when a new PO is created.
    can be achievd by using  class cl_bcs and BADI method
    IF_EX_ME_PROCESS_PO_CUST~POST of BADI ME_PEOCESS_PO_CUST.
    We can aslo configure the OUTPUT TYPE as MAIL in transaction NACE. This is usually doen by the Functional consultant.
    Pls look into these exapmles which clearly explains abt the process of sending a  mail-
    Sending Mail using class cl_bcs
    Re: Mail sending program
    Re: SCOT and FM 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    Reward if helpful.
    Best Wishes,
    Chandralekha

  • Any one have any information about Security Group to send it to me

    any one have any information about Security Group to send it to me
    what is it and how can we use it in our work

    Have a look in the general R12 MOAC and FA concepts.
    With security groups, you can defined a set of organizations with a shared access.
    E.g. you defined one Secruity groups and assigned in these group 5 organizations.
    The security group is assign to a responsibility.
    You have access to these 5 organizations over one responsibility, you must not change the responsibility, if you will enter transactions for a other organization.

  • Need to send a mail when job window time is over

    Hi ,
    select * from v$version;
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    PL/SQL Release 11.2.0.2.0 - Production
    CORE 11.2.0.2.0 Production
    TNS for Linux: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production
    ========
    I have created a job using dbms_scheduler.create_job with a 1 hour window ( created using dbms_scheduler.create_window ) .
    My job triggers a stored procedure . Now I have a send_mail code at the end of the stored procedure which sends a mail with plsql log as an attachment . When my job runs more than 1 hour the stored proc is getting stopped and not triggering the mail though I put the same code in exception block ( exception when others ) .
    CREATE OR REPLACE PROCEDURE my_sp
    AS
    BEGIN
    -- some code ---
    begin
    -- send mail --
    end
    EXCEPTION
    WHEN OTHERS
    THEN
    send mail ( Can I get this piece when window time is over )
    END;
    Is there any other way I can run the last piece of the proc (send_mail) .
    Thanks ,
    Mahesh

    Mahesh wrote:
    Folllowing below note .
    http://download.oracle.com/docs/cd/E14072_01/server.112/e10595/scheduse008.htm
    but need to attach a file .
    SQL> desc utl_mail
    PROCEDURE SEND
    Argument Name               Type               In/Out Default?
    SENDER                VARCHAR2          IN
    RECIPIENTS               VARCHAR2          IN
    CC                    VARCHAR2          IN     DEFAULT
    BCC                    VARCHAR2          IN     DEFAULT
    SUBJECT               VARCHAR2          IN     DEFAULT
    MESSAGE               VARCHAR2          IN     DEFAULT
    MIME_TYPE               VARCHAR2          IN     DEFAULT
    PRIORITY               BINARY_INTEGER          IN     DEFAULT
    REPLYTO               VARCHAR2          IN     DEFAULT
    PROCEDURE SEND_ATTACH_RAW
    Argument Name               Type               In/Out Default?
    SENDER                VARCHAR2          IN
    RECIPIENTS               VARCHAR2          IN
    CC                    VARCHAR2          IN     DEFAULT
    BCC                    VARCHAR2          IN     DEFAULT
    SUBJECT               VARCHAR2          IN     DEFAULT
    MESSAGE               VARCHAR2          IN     DEFAULT
    MIME_TYPE               VARCHAR2          IN     DEFAULT
    PRIORITY               BINARY_INTEGER          IN     DEFAULT
    ATTACHMENT               RAW               IN
    ATT_INLINE               BOOLEAN           IN     DEFAULT
    ATT_MIME_TYPE               VARCHAR2          IN     DEFAULT
    ATT_FILENAME               VARCHAR2          IN     DEFAULT
    REPLYTO               VARCHAR2          IN     DEFAULT
    PROCEDURE SEND_ATTACH_VARCHAR2
    Argument Name               Type               In/Out Default?
    SENDER                VARCHAR2          IN
    RECIPIENTS               VARCHAR2          IN
    CC                    VARCHAR2          IN     DEFAULT
    BCC                    VARCHAR2          IN     DEFAULT
    SUBJECT               VARCHAR2          IN     DEFAULT
    MESSAGE               VARCHAR2          IN     DEFAULT
    MIME_TYPE               VARCHAR2          IN     DEFAULT
    PRIORITY               BINARY_INTEGER          IN     DEFAULT
    ATTACHMENT               VARCHAR2          IN
    ATT_INLINE               BOOLEAN           IN     DEFAULT
    ATT_MIME_TYPE               VARCHAR2          IN     DEFAULT
    ATT_FILENAME               VARCHAR2          IN     DEFAULT
    REPLYTO               VARCHAR2          IN     DEFAULT

  • Need  help sending e-mail a mobile messages

    hi!
    i'm a n00b in Java. Can you please tell how can i send e-mail and mobile messages in java?
    thnx!!

    First of all, before you do any programming, if you want to have your computer send e-mail messages then you must have access to an SMTP server.
    Next, if you do have access to one, then JavaMail is a common way to write programs that send e-mail.
    As for mobile messages ("text messages" to a cellphone?) you usually need a contract with some phone company to do that, so they can bill you for it.
    When you find out about that, they should provide you with documentation on how to proceed. If it involves sending e-mail to a particular address, see part 1 of this reply.

  • Need to send a mail from a specific From mail ID thorgh specific Mail serve

    Hi,
    If any errors occured in my interface validation program(plsql) I need to send mail to some mail ids,
    But I need to use specific from mail id and mail server.
    I have no idea of Shell scripting, I tried it with plsql itself but not worked. My Application server is different from DB server.
    Please let me know if any one has the code or any thoughts.
    Thanks

    Please see these links.
    https://forums.oracle.com/forums/search.jspa?threadID=&q=UTL_SMTP&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    https://forums.oracle.com/forums/search.jspa?threadID=&q=Send+AND+email+AND+PL%2FSQL&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    https://forums.oracle.com/forums/search.jspa?threadID=&q=Email+AND+PL%2FSQL&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    Thanks,
    Hussein

  • Working in ECC 5.0..After approve, i need to send confirmation mail to all

    Hi,
    I am working in ECC 5.0...This is my requirement..
    After receiving the workitem approval message in managers inbox..after he approves/rejects,whatever approval i need to send back confirmation mail to Employee as well as payroll and admistrator and also two managers.
    Could u pls... how can i proceed with this scenario..
    Thanks and Have a nice day!!!
    Soni

    Hi Soni,
    We have handled a similar requirement in our project  , by writing a Custom function module for sending mails to Initiator, Payroll and managers approving the form.
    Actually we had created a custom function module for sending a mail.
    And this was called in one of the Method of the Business Object. (e.g: SENDMAIL - ZBUS7051 )
    and a background Step was defined in the Workflow template, which uses a task defined using the BOR Object - ZBUS7051 - SENDMAIL.
    Hope this helps.
    Regards,
    Raj

  • What are the prerequisits i need to send a mail using java mail

    i have a class file using javamail.
    I want to validate the email id's and send to particular address.
    will u please tell me the process and prerequisits to send the mail(like SMTP server,username ,password..)
    Please what actually username , password is ment in an authenticated javamail program.
    is it user account on SMTP server / email id
    Thanks.
    Prasantha Reddy C

    Hi,
    you need your smtp host address and smtp user name and password to send emails out.
    and yes the user name and password are the smtp username and password for authentication
    regards
    shyam

  • Response from webservice needs to send as Mail content

    Hello,
    i have to configure a scenario as given below
               IDOC --> JDBC --> WebService and response from WebService to SMTPmail receiver.
    now i got strucked at Webservice response. after i got the response from WebService(SOAP), i need to send the both Request and response to Mail Receiver. So Please let me know how to capture request and response both to my SMTPmail adapter(as content or attachment).let me know the steps to proceed for SMTPmail Receiver
    Regards,SARAN

    Hi Raj,
    Thanks for teh reply.
    i have already configured teh above mentioned scenario.but i am not able to get Request and response.
    Could you pelase provide teh steps how to configure BPM in this scenario..(as ia m not handson with BPM)
    Reagrds,Saran

  • Need to send a mail back to the user in Sender Mail adapter Scenario

    Hi all,
    I have a scenario where the user fills the Price form  or the Article form (which is a Adobe Form).When the user clicks on the "submit" button,the form is converted into xml , gets attached to the mail and sent to PI.
    Now the user sometimes attaches the pdf directly instead of submitting the form. This results in the mail being sent
    with pdf  as attachment.
    Now my requirement  is to send a mail back to the user asking them to send an xml  instead of a pdf.
    How can this be done ?
    Kindly let me know friends.
    Quick Response is appreciated.

    hi Sanjay,
    Have a look on Michal's blog, it's for JMS, but it works for others: [PI/XI: Quick tip: Preserving attributes of XI messages via MultipartHeaderBean|PI/XI: Quick tip: Preserving attributes of XI messages via MultipartHeaderBean]
    Mickael

  • What information do I need to send in my IPod touch to be replaced and how do i get the box to ship it in

    What info do i need to send in my ipod touch to be replaced (i still have the 1 year warranty) and how do i get the box to ship it in also I have no clue what the address is please help

    The instructions on how to obtain warranty work is covered here:
    Apple - Support - iPod - Service FAQ

Maybe you are looking for

  • Import package declarations

    Hi All, Is there any difference in terms of efficiency, class loading etc. in a program when I use the following?: import java.util.ArrayList; as opposed to: import java.util.*; This is assuming that ArrayList will be the only class that I will be us

  • IN Clause with Ampersand(Lexical Parameters) not working plz help

    hi I m writing the following query but it is not working. plz help how can i apply ampersend(lexical parameter) with IN clause. select * from emp where to_number(empno) IN (&p_1); thnx

  • EAP-TLS auth between 2 1310 bridges

    Hello, Am working on getting EAP-TLS auth working between a root and non-root 1310 bridge. I've had success getting LEAP working but EAP-TLS is kicking my butt. I have an ACS 4.1 server acting as the Radius server and the auth is failing there with t

  • SYS packages are invalid in oracle 10g (10.2.0.4)

    I am using Oracle 10g (10.2.0.4) in AIX 6.1 server . According to OEM advice I remove the 'utl_file' privelege from PUBLIC user . In that moment I get some packages of the 'SYS' schema invalid . I again give the grant permission of the 'UTL_FILE' to

  • Changing ALLOCATION_TYPE for a tablespace

    Hi, I dropped one tablespace and re-created it in Oracle 9i database,but after the creation when i checked the ALLOCATION_TYPE its value is SYSTEM,is there any way to change it to USER which is what required. Regards, Cherry