How to send mail to the yahoo address?...

I try to send the mail to the external address: [email protected]
but the application is error:
nested exception is:
     javax.mail.SendFailedException: Invalid Addresses;
nested exception is:
     javax.mail.SendFailedException: 553 sorry, that domain isn't in my list of allowed rcpthosts (#5.7.1)
Please help!
Is there any resources about send mail by smtp about JavaMail?
Thanks a lot!

take a look at
http://www.palomine.net/qmail/relaying.html
http://www.palomine.net/qmail/selectiverelay.html

Similar Messages

  • How can i send mail to the yahoo mail or gmail or something else

    hello guys,
    i want to know how to send mails to the yahoo or gmail or something else.i heard that we have to change some smtp address and some port number. can any body suggest me to get that.please help me
    any replies will be appreciated greatly.

    Hi chnaresh,
    This is the code I use to send mail, it's not specific to gmail, but it works. The "props" object expects the usual mail properties, "mail.smtp.host", "mail.user" or "mail.smtp.user", as well as "mail.smtp.ssl" which you'd want to set to "true" if you're using gmail. It also expects "mail.smtp.passwd" or "mail.passwd" which my gut tells me is unsafe, but I'm not sure why.
    Good luck,
    radikal_3dward
    public static int sendMail(final Properties props, String subject, String body, String to, String cc, String bcc, String from, File[] attachments, boolean toStdOut)
    throws javax.mail.internet.AddressException, javax.mail.MessagingException, javax.mail.NoSuchProviderException
    Session sess;
    //props.setProperty("mail.debug", "true");
    if(props.getProperty("mail.smtp.ssl") != null && props.getProperty("mail.smtp.ssl").equalsIgnoreCase("true"))
    Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
    String portStr = ((props.getProperty("mail.smtp.port") != null) ? (props.getProperty("mail.smtp.port")) : "465");
    props.put("mail.smtp.auth", "true");
    props.put("mail.smtp.socketFactory.port", portStr);
    props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
    props.put("mail.smtp.socketFactory.fallback", "false");
    sess = Session.getDefaultInstance(props,
    new javax.mail.Authenticator()
    protected PasswordAuthentication getPasswordAuthentication()
    String userName = ((props.getProperty("mail.smtp.user") != null) ? props.getProperty("mail.smtp.user") : props.getProperty("mail.user"));
    String passwd = ((props.getProperty("mail.smtp.passwd") != null) ? props.getProperty("mail.smtp.passwd") : props.getProperty("mail.passwd"));
    if(userName == null || passwd == null)
    return null;
    return new PasswordAuthentication(userName , passwd);
    else
    String portStr = ((props.getProperty("mail.smtp.port") != null) ? (props.getProperty("mail.smtp.port")) : "25");
    sess = Session.getInstance(props, null);
    //sess.setDebug(true);
    MimeMessage mess = new MimeMessage(sess);
    mess.setSubject(subject);
    StringTokenizer toST = new StringTokenizer(to, ",;");
    while(toST.hasMoreTokens())
    Address addr = new InternetAddress(toST.nextToken());
    mess.addRecipient(Message.RecipientType.TO, addr);
    if(from != null)
    StringTokenizer fromST = new StringTokenizer(from, ",;");
    InternetAddress[] fromAddrs = new InternetAddress[fromST.countTokens()];
    for(int i = 0; fromST.hasMoreTokens(); i++)
    fromAddrs[i] = new InternetAddress(fromST.nextToken());
    mess.addFrom(fromAddrs);
    if(cc != null)
    StringTokenizer ccST = new StringTokenizer(cc, ",;");
    while(ccST.hasMoreTokens())
    Address addr = new InternetAddress(ccST.nextToken());
    mess.addRecipient(Message.RecipientType.CC, addr);
    if(bcc != null)
    StringTokenizer bccST = new StringTokenizer(bcc, ",;");
    while(bccST.hasMoreTokens())
    Address addr = new InternetAddress(bccST.nextToken());
    mess.addRecipient(Message.RecipientType.BCC, addr);
    BodyPart messageBodyPart = new MimeBodyPart();
    Multipart multipart = new MimeMultipart();
    if(body != null)
    messageBodyPart.setText(body);
    multipart.addBodyPart(messageBodyPart);
    if(attachments != null)
    for(int i = 0; i < attachments.length; i++)
    messageBodyPart = new MimeBodyPart();
    DataSource source = new FileDataSource(attachments);
    messageBodyPart.setDataHandler(new DataHandler(source));
    messageBodyPart.setFileName(attachments[i].getName());
    multipart.addBodyPart(messageBodyPart);
    mess.setContent(multipart);
    Address[] allRecips = mess.getAllRecipients();
    if(toStdOut)
    System.out.println("done.");
    //System.out.println("Sending message (\"" + mess.getSubject().substring(0,10) + "...\") to :");
    System.out.println("Sending message (\"" + mess.getSubject() + "...\") to :");
    for(int i = 0; i < allRecips.length; i++)
    System.out.print(allRecips[i] + ";");
    System.out.println("...");
    Transport.send(mess);
    if(toStdOut)
    System.out.println("done.");
    return 0;

  • Sending mail to an internet address through a sendmail step.

    Hi,
    I have done this before. If I mention the SAP logon id as user (
    for agent determination) and if I change the typeid to be 'U'. It is giving an error. I guess I'm missing something here...
    Thanks.
    Sukumar.

    Sukumar,
    Like I said in last post, you want to send out email to xx at rate of xy.com so you have to pass this value in binding with &addressstring&. Now you want to derive your email address from your SAP user id, you have to use FM for that, which will have user id as an input and will find out email address (there are several FM, just search forum).
    Alternatively if HR OM is available the read the info type 0105 and you will get both (sap user name and sap user id).
    So in your workflow, before send mail get the email address and bind it. typeid has to be U
    Hope it clarifes.
    If you still face some issue, please be elaborate question, as this is little confusing.
    Cheers
    Jai

  • How can i insure that job finished and good  and send mail to the user  ?

    how can i insure that job finished and good  ,
    and how can i send mail to the user "ok"   ?

    Hi Dakota.  We do something simular with our nightly MRP job.  Our MRP job runs around midnight,  then we kick off another job about 4am which checks to see if any of the jobs in question have abended, if so,  then it sends an email to the email addresses specify in the report variant.  Of course, this could be modified to check for successfully complete jobs, if that is your requirement.
    REPORT ZBCJOBMONITOR .
    TABLES: SOMLREC90,
            TBTCO.
    DATA: MAILDATA   LIKE SODOCCHGI1.
    DATA: MAILTXT    LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
    DATA: MAILREC    LIKE SOMLREC90 OCCURS 0  WITH HEADER LINE.
    DATA: I_TBTCO    LIKE TBTCO OCCURS 0 WITH HEADER LINE.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001 .
    SELECT-OPTIONS: S_JOB FOR TBTCO-JOBNAME.
    SELECT-OPTIONS: S_JOBC FOR TBTCO-JOBClass.
    SELECT-OPTIONS: S_REC FOR SOMLREC90-RECEIVER.
    SELECTION-SCREEN END OF BLOCK B1.
    START-OF-SELECTION.
      CLEAR:    MAILDATA, MAILTXT, MAILREC, I_TBTCO.
      REFRESH:  MAILTXT, MAILREC, I_TBTCO.
      PERFORM GET_ABENDED_JOBS.
      PERFORM BUILD_RECEIVERS.
      LOOP AT I_TBTCO.
        PERFORM BUILD_TEXT_MESSAGE.
        PERFORM SEND_MAIL_NODIALOG..
      ENDLOOP.
    *      Form  BUILD_TEXT_MESSAGE
    FORM GET_ABENDED_JOBS.
      SELECT * FROM TBTCO
              INTO CORRESPONDING FIELDS OF TABLE I_TBTCO
                         WHERE JOBNAME IN S_JOB
                           AND STATUS = 'A'
                           AND JOBCLASS IN S_JOBC
                           AND SDLSTRTDT = SY-DATUM.
    ENDFORM.
    *      Form  BUILD_TEXT_MESSAGE
    FORM BUILD_TEXT_MESSAGE.
      DATA: DATE(10) TYPE C.
      DATA: TIME(10) TYPE C.
      MAILDATA-OBJ_NAME = 'MONITOR'.
      MAILDATA-OBJ_DESCR = 'Batch Job Monitor'.
      MAILDATA-OBJ_LANGU = SY-LANGU.
      CONCATENATE 'Job Name:' I_TBTCO-JOBNAME
                  INTO MAILTXT-LINE SEPARATED BY SPACE.
      APPEND MAILTXT.
      PERFORM FORMAT_DATE USING I_TBTCO-SDLSTRTDT
                                DATE.
      CONCATENATE I_TBTCO-SDLSTRTTM+0(2) ':'
                  I_TBTCO-SDLSTRTTM+2(2) ':'
                  I_TBTCO-SDLSTRTTM+4(2)
                     INTO TIME.
      CONCATENATE 'Start Date/Time:' DATE TIME
                INTO MAILTXT-LINE SEPARATED BY SPACE.
      APPEND MAILTXT.
      CONCATENATE 'Job Class:' I_TBTCO-JOBCLASS
                INTO MAILTXT-LINE SEPARATED BY SPACE.
      APPEND MAILTXT.
      MAILTXT-LINE = 'Job has terminated abnormally'.
      APPEND MAILTXT.
    ENDFORM.
    *      Form  BUILD_RECEIVERS
    FORM BUILD_RECEIVERS.
      LOOP AT S_REC.
        CLEAR MAILREC.
        MAILREC-RECEIVER = S_REC-LOW.
        MAILREC-REC_TYPE  = 'U'.
        APPEND MAILREC.
      ENDLOOP.
    ENDFORM.
    *      Form  SEND_MAIL_NODIALOG
    FORM SEND_MAIL_NODIALOG.
      CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
           EXPORTING
                DOCUMENT_DATA              = MAILDATA
                DOCUMENT_TYPE              = 'RAW'
                PUT_IN_OUTBOX              = 'X'
           TABLES
                OBJECT_HEADER              = MAILTXT
                OBJECT_CONTENT             = MAILTXT
                RECEIVERS                  = MAILREC
           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.
    ENDFORM.
    *      Form FORMAT_DATE
    FORM FORMAT_DATE USING IN
                           OUT.
      CALL FUNCTION 'CONVERT_DATE_TO_EXTERNAL'
           EXPORTING
                DATE_INTERNAL            = IN
           IMPORTING
                DATE_EXTERNAL            = OUT
           EXCEPTIONS
                DATE_INTERNAL_IS_INVALID = 1
                OTHERS                   = 2.
    ENDFORM.
    Regards,
    Rich Heilman

  • Mail goes to BULK folder , how to send it to the INBOX folder

    When I try to send mail throgh the java mail concept it is going to the bulk folder , my requirment is to send the mail to the inbox , is anything i have to set to send the mail to the inbox.
    Thanx in advance
    Have a nice day.

    I think its nothing to do with java mail api, it the mail service provider which filter the incoming mail and thinks that it is a junk mail adding it to the bulk folder. If you can open the email and mark the email through which u are sending mails as not junk, then the future email throug this address will be delivered into inbox.

  • I have 2 email addresses set up on my iphone 5, 1 can send mail and the other can't... have tried deleting and adding the account, no luck, have tried all suggestions... anyone help?

    I have recently purchased the iphone 5S and have two AOL email accounts set up on it. They could both receive and send mail on the first day, but from the second day only 1 can send mail (both still receive). I get an message saying "Unable to send mail. A copy has been placed in your Outbox. Sending the message content to the server failed." This has been the response now for 3 days and suddenly this morning, I was able to send an email from this account, but only the one and now it's back to that same message. I have deleted and added the account again, using various methods. I even reset my phone and set it all up again from beginning with no luck. It is very frustrating and I am unsure why I can't send from both accounts, especially being that they are the same provider. I have read forums and it appears many have this same problem and I wondered if anyone has had it recently on this phone and how they fixed it. Someone said just use the AOL app to send from this account, yes that can be done, but it's inconvenient having to sign in all the time when i have a mail app that should work automatically. Any suggestions would be welcomed!!

    I am not sure if this issue is going to help you but lets give it a try.
    I know that where im from, which is the Netherlands, I am not able to sent e-mails from my iPhone or any other mobile device by using 3G or a random WIFI acces point. The provider only allowes you to sent e-mails when you are connected to a network of there own. Which means if you have provider "101" and your email settings are set up for this provider in your iPhone but your using the network of a friend of yours which is provider "202" you cannot sent emails from his network. Though you can receive them you may not sent.
    As I said, I am not aware if this issue is the same for you totaly depents on the country and provider your using.

  • I'm trying to reset my apple ID password but forgot my security questions. Apple are sending the confirmation e-mail to the wrong address, please help?

    I'm trying to reset my apple ID password but forgot my security questions. Apple are sending the confirmation e-mail to the wrong address, please help?

    Hello AndrewsAFCx,
    Thank you for using Apple Support Communities!
    If you cannot remember your security questions for your Apple ID, I would recommend these steps outlined in the article named:
    Apple ID: All about Apple ID security questions
    http://support.apple.com/kb/HT5665
    What should I do if I don't remember the answers to my Apple ID security questions?
    Try answering them at least once to see if you can get them right, even if you are not sure you remember the answers to your security questions.
    If you are confident you can't remember them, try one of the following:
    If you have three security questions and a rescue email address
    sign in to My Apple ID and select the Password and Security tab to send an email to your rescue email address to reset your security questions and answers. 
    If you have one security question and you know your Apple ID passwordsign in to My Apple ID and select the Password and Security tab to reset your security question.
    If you have one security question, but don't remember your Apple ID password
    contact Apple Support for assistance. Learn more about creating a temporary support PIN to help Apple confirm your identity when you contact Apple Support.
    Note: If you have forgotten your password and answer your security questions incorrectly too many times in a row, you will be unable to try to answer your security questions for a period of time. During that time you will not be able to reset your password and will not have access to your account.
    All the best,
    Sterling

  • How to send mails in HTML format from the send mail step of workflow?

    Hi,
    I have a requirement where I need to send mails in the html format from the send mail step of the workflows.
    But what I found out that the html tags are not renderd and as such the output is in plain text.
    I know that there is an alternative of using an activity step and use my own custom code from within there,But due to certain business constraints, I need to use the send mail step only.
    My SCOT settings are all right.
    Please let me know how it can be done.
    Thanks,
    Samrat.

    Samrat,
    It can't be done, you have to use your own activity step.
    What are these constraints that refrain you from doing that?
    Rgds,
    Patrick

  • How do I fix this error "An error occurred while sending mail. The mail server responded: Authentication is required before sending [R0107005]. Please verify

    My previous request had an incorrect email. This error began yesterday and I can't reply or send new emails from my PC, but email is working on my iphone.

    I have been doing that. Here is the complete message I get. It was cut off in my initial question. "An error occurred while sending mail. The mail server responded: Authentication is required before sending [R0107005]. Please verify that your email address is correct in your Mail preferences and try again."

  • I am using Mail 5.3 with two separate gmail addresses. One is personal the other is business. When I send emails from the business address, any auto-replies I get COME TO THE PERSONAL INBOX. I imagine that this is a setting? Please help!

    I am using Mail 5.3 with two separate gmail addresses.
    One is personal the other is business.
    When I send emails from the BUSINESS address, any auto-replies/out of office notices I get come to my PERSONAL INBOX.
    I imagine that this is a setting? Please help!

    Edit the SMTP server list. Add a new one for the business account. Put the correct password and information for it. Give it a description so you will know which server is which. Mke sure the correct server is highlighted in the account selected and check the box to use only that server for that account. Do that for the other account also.

  • TS3276 I am unable to access mail on icloud or send mail through the icloud account.  How can I get mail routed through the icloud account.

    I am unable to access mail on icloud or send mail through the icloud

    Here is how to set up your iCloud email account:
    http://www.apple.com/support/macosx/mailassistant/

  • How can send mails using hotmail/rediffmail domain name?

    I have used the below code to send a mail using javamail API?Even when I am sending my application does not have notified any of error/exceptions,But the message is not reached to I have given receipient's address in the to field.
    import javax.mail.*;
    import javax.mail.internet.*;
    import javax.activation.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.util.*;
    public class Sendmail1 extends HttpServlet {
    private String smtpHost;
    // Initialize the servlet with the hostname of the SMTP server
    // we'll be using the send the messages
    public void init(ServletConfig config)
    throws ServletException {
    super.init(config);
    smtpHost = config.getInitParameter("smtpHost");
    //smtpHost = "sbm5501";
    smtpHost = "www.rediffmail.com";
    public void doGet(HttpServletRequest request,HttpServletResponse response)
    throws ServletException, java.io.IOException {
    String from = request.getParameter("from");
    String to "[email protected]";
    String cc = "[email protected]";
    String bcc ="[email protected]";
    String smtp ="www.rediffmail.com";
    String subject = "hai";
    String text = "Hai how r u";
    PrintWriter writer = response.getWriter();
    if (subject == null)
    subject = "Null";
    if (text == null)
    text = "No message";
    String status;
    try {
    // Create the JavaMail session
    java.util.Properties properties = System.getProperties();
    if (smtp == null)
    smtp = "www.rediffmail.com";
    properties.put("mail.smtp.host", smtp);
    Session session = Session.getInstance(properties, null);
    //to connect
    //Transport transport =session.getTransport("smtp");
    //transport.connect(smtpHost,user,password);
    // Construct the message
    MimeMessage message = new MimeMessage(session);
    // Set the from address
    Address fromAddress = new InternetAddress(from);
    message.setFrom(fromAddress);
    // Parse and set the recipient addresses
    Address[] toAddresses = InternetAddress.parse(to);
    message.setRecipients(Message.RecipientType.TO,toAddresses);
    Address[] ccAddresses = InternetAddress.parse(cc);
    message.setRecipients(Message.RecipientType.CC,ccAddresses);
    Address[] bccAddresses = InternetAddress.parse(to);
    message.setRecipients(Message.RecipientType.BCC,bccAddresses);
    // Set the subject and text
    message.setSubject(subject);
    message.setText(text);
    Transport.send(message);
    //status = "<h1>Congratulations,</h1><h2>Your message was sent.</h2>";
    } catch (AddressException e)
    status = "There was an error parsing the addresses. " + e;
    } catch (SendFailedException e)
    status = "<h1>Sorry,</h1><h2>There was an error sending the message.</h2>" + e;
    } catch (MessagingException e)
    status = "There was an unexpected error. " + e;
    // Output a status message
    response.setContentType("text/html");
    writer.println("<title>sendForm</title><body bgcolor= ><b><h3><font color=green><CENTER>CALIBERINFO.COM</CENTER></h3>Your message was sent to recepient(s).<br><font color=red>"+"\n"+to);
    writer.println("<br><br><a href=e:/mail/javamail/mail.html>back to compose</a>");
    writer.close();
    Please any one help me out from this probs.
    Awaiting for yours reply,
    or give me a reply to: [email protected]
    Regards,
    @maheshkumar.k

    Hi,
    how can send mails using hotmail/rediffmail domain name?In your java application,you specified www.rediffmail.com as your
    smtp server.But that is the address of that website.Try will a smtp
    server instead.For a list of free smtp servers,please visit http://www.thebestfree.net/free/freesmtp.htm
    Hope this helps.
    Good Luck.
    Gayam.Srinivasa Reddy
    Developer Technical Support
    Sun Microsystems
    http://www.sun.com/developers/support/

  • When I send mail, I keep getting this message. An error occurred while sending mail. The mail server responded: "JunkMail rejected - 71-12-190-31.dhcp.leds.al

    When I send mail, I keep getting this message.
    An error occurred while sending mail. The mail server responded: "JunkMail rejected - 71-12-190-31.dhcp.leds.al.charter.com ([127.0.0.1])
    [71.12.190.31]:52956 is in an RBL, see
    http://www.spamhaus.org/query/bl?ip=71.12.190.31". Please check the message recipient [email protected] and try again.
    How do I get rid of this problem?
    WNS

    Hi there,
    If you have a closer look at message you are receiving it already states the problem. The domain 71-12-190-31.dhcp.leds.al.charter.com is blacklisted by spamhaus.org (is in an RBL).
    Your TB is (my guess) setup to send the message directly to the recipient.
    As a rule of thumb the majority of mail sent from a dynamic dns address (the kind of address you are getting from your ISP) is blacklisted as a precaution against spam abuse due to virus/trojan infected PC's.
    Nothing you can change there. Stop sending the message directly and use your ISP's account instead.
    /Frans

  • Problem in sending mail with the given code

    package booodrive;
    Some SMTP servers require a username and password authentication before you
    can use their Server for Sending mail. This is most common with couple
    of ISP's who provide SMTP Address to Send Mail.
    This Program gives any example on how to do SMTP Authentication
    (User and Password verification)
    This is a free source code and is provided as it is without any warranties and
    it can be used in any your code for free.
    Author : Sudhir Ancha
    import javax.mail.*;
    import javax.mail.internet.*;
    import java.util.*;
    import java.io.*;
      To use this program, change values for the following three constants,
        SMTP_HOST_NAME -- Has your SMTP Host Name
        SMTP_AUTH_USER -- Has your SMTP Authentication UserName
        SMTP_AUTH_PWD  -- Has your SMTP Authentication Password
      Next change values for fields
      emailMsgTxt  -- Message Text for the Email
      emailSubjectTxt  -- Subject for email
      emailFromAddress -- Email Address whose name will appears as "from" address
      Next change value for "emailList".
      This String array has List of all Email Addresses to Email Email needs to be sent to.
      Next to run the program, execute it as follows,
      SendMailUsingAuthentication authProg = new SendMailUsingAuthentication();
    public class SendMailUsingAuthentication
      private static final String SMTP_HOST_NAME = "sample.com";
      private static final String SMTP_AUTH_USER = "demo";
      private static final String SMTP_AUTH_PWD  = "demo";
      private static final String emailMsgTxt      = "Online Order Confirmation Message. Also include the Tracking Number.";
      private static final String emailSubjectTxt  = "Order Confirmation Subject";
      private static final String emailFromAddress = "[email protected]";
      // Add List of Email address to who email needs to be sent to
      private static final String[] emailList = {"[email protected]"};
      public static void main(String args[]) throws Exception
        SendMailUsingAuthentication smtpMailSender = new SendMailUsingAuthentication();
        smtpMailSender.postMail( emailList, emailSubjectTxt, emailMsgTxt, emailFromAddress);
        System.out.println("Sucessfully Sent mail to All Users");
      public void postMail( String recipients[ ], String subject,
                                String message , String from) throws MessagingException
        boolean debug = false;
         //Set the host smtp address
         Properties props = new Properties();
         props.put("mail.smtp.host", SMTP_HOST_NAME);
         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.setContent(message, "text/plain");
    Transport.send(msg);
    * SimpleAuthenticator is used to do simple authentication
    * when the SMTP server requires it.
    private class SMTPAuthenticator extends javax.mail.Authenticator
    public PasswordAuthentication getPasswordAuthentication()
    String username = SMTP_AUTH_USER;
    String password = SMTP_AUTH_PWD;
    return new PasswordAuthentication(username, password);
    package booodrive;
    public class Test {
         public static void main(String args[]){
              SendMailUsingAuthentication authProg = new SendMailUsingAuthentication();
    I am not able to send mail using the above given codes. Can anyone please help?
    Rony
    Edited by: RonyFederer on Aug 10, 2008 9:04 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Your first step is to diagnose the problem.
    1. Does the code compile? If not, what error messages appear?
    2. Does the code run? If not, what error messages appear? What's in the stack trace?
    3. Does the code do what you expect it to do? If not, what are the differences?

  • Sending Mail to Multiple To addresses

    Hi!
    I want to know how to send mail to multiple mail addresses.
    Thanks!

    Hi sowmiya,
    This code would do the stuff u wanted
    import java.util.Properties;
    import javax.mail.*;
    import javax.mail.internet.*;
    public class MailExample {
    public static void main (String args[]) throws Exception {
    String host = "";
              String from = "[email protected]";
              //String to = "karthik@";
              String conf_email="[email protected]";
              String temp_pwd="tererere";
              String recipients = "[email protected],[email protected]";
              // Get system properties
              Properties props = System.getProperties();
              // Setup mail server
              props.put("mail.smtp.host", host);
              // Get session
              Session sessionobj = Session.getDefaultInstance(props, null);
              // Define message
              MimeMessage message = new MimeMessage(sessionobj);
              // Set the from address
              message.setFrom(new InternetAddress(from));
              // Set the to address for a single recipient
              // message.addRecipient(Message.RecipientType.TO,new InternetAddress("[email protected]"));
              message.setRecipients(Message.RecipientType.TO,InternetAddress.parse(recipients, false));
              // Set the subject
              message.setSubject("test");
              // Set the content
              message.setText("test");
              // Send message
         Transport.send(message);

Maybe you are looking for

  • G6 Zoom Knob is stuck!!

    I bought this Canon G6 in 2004.  it has been a good camera. A few issues i have is that the rubber habd grip is coming off, the LCD swivel screen is loose, even thoiugh the two screws are still very tight, and FINALLY, just yeaterday i was taking pho

  • I keep getting the following error message while sharing my iMovie to iDVD.  "Unable to prepare project for publishing"  error (-2125).

    I keep getting the following error message while sharing my iMovie to iDVD.  "Unable to prepare project for publishing"  error (-2125).  I'm running iMovie 09 v. 8.0.6 on a iMac with OSX v 10.6.8, 2Ghz core duo, 1GB 667 Mhz DDR2 SDRAM.  Any ideas why

  • Printing problem in reports 6i

    hi, i dont know where to post this quastion, but please please i need help i have created an application using forms & reports 6i and database 9i,in this application i run a report which prints an id card i use card printer ( fargo cardpro printer) t

  • Work schedule shows a holiday but it is not defined

    Hi All, I have run PT03 to check on my work schedule and it shows a date that is a holiday. I have checked the public holiday calendar and no holiday defined on that day. Checking again on the generated work schedule and clicking on the date where it

  • ITunes Radio is not showing up on my iPad

    iTunes Radio is not showing up on my iPad now. It was there after my iOS 7 upgrade. Can't find it now. Please help. Thanks.