Problem Sending mail Using Godaddy

Hi all. I will be very thank to all. Please help me.!!!
I have small problem while I send mail using Godaddy smtpout server. It is my code :
     Properties props = System.getProperties();
     props.setProperty("mail.transport.protocol", "smtp");
     props.setProperty("mail.host", "smtpout.secureserver.net");
     props.put("mail.smtp.auth", "true");
     props.setProperty("mail.user", "fengshuiMail");
     props.setProperty("mail.password", "here_my_password");
     Session mailSession = Session.getDefaultInstance(props, null);
     mailSession.setDebug(true);
     Transport transport = mailSession.getTransport("smtp");
     MimeMessage message = new MimeMessage(mailSession);
     message.setSentDate(new Date());
     message.setSubject("Feng Shui 5 Saved Reference ");
     message.setFrom(new InternetAddress("[email protected]"));
               message.addRecipient(Message.RecipientType.TO, new InternetAddress("my_email_here"));
     MimeMultipart multipart = new MimeMultipart("related");
     // first part (the html)
     BodyPart messageBodyPart = new MimeBodyPart();
     messageBodyPart.setContent("TestMail", "text/plain");
     // add it
     multipart.addBodyPart(messageBodyPart);
     // put everything together
     message.setContent(multipart);
     transport.connect("smtpout.secureserver.net", "fengshuiMail",
                         "here_my_password");
     transport.sendMessage(message, message
                         .getRecipients(Message.RecipientType.TO));
     transport.close();I receive this exceptions :
java.security.AccessControlContext.checkPermission(AccessControlContext.java:264) java.security.AccessController.checkPermission(AccessController.java:427) java.lang.SecurityManager.checkPermission(SecurityManager.java:532) java.lang.SecurityManager.checkConnect(SecurityManager.java:1031) java.net.InetAddress.getAllByName0(InetAddress.java:1117) java.net.InetAddress.getAllByName0(InetAddress.java:1098) java.net.InetAddress.getAllByName(InetAddress.java:1061) java.net.InetAddress.getByName(InetAddress.java:958) java.net.InetSocketAddress.(InetSocketAddress.java:124) java.net.Socket.(Socket.java:178) com.sun.mail.util.SocketFetcher.getSocket0(SocketFetcher.java:130) com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:112) com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:959) com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:197) javax.mail.Service.connect(Service.java:233) javax.mail.Service.connect(Service.java:134) Email.doGet(Email.java:63) javax.servlet.http.HttpServlet.service(HttpServlet.java:689) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) sun.reflect.GeneratedMethodAccessor149.invoke(Unknown Source) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke(Method.java:585) org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:239) java.security.AccessController.doPrivileged(Native Method) javax.security.auth.Subject.doAsPrivileged(Subject.java:517) org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:266) org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:157) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:50) org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:140) java.security.AccessController.doPrivileged(Native Method) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:136) org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214) org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198) org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152) org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137) org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102) org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:535) org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102) org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:417) org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102) org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929) org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160) org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:300) org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:374) org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:743) org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:675) org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:866) org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683) java.lang.Thread.run(Thread.java:595)
But from my local machine it work good. From godaddy server it NOt send mail.

Hey there,
I am running into the same issue.
I am not able to send emails from my email account with godaddy to gmail accounts.
I tried your code with relay----- SMTP server, but it didn't work.
Could you please give me the complete working code?
It will be quite a help.
Thanks.
Ajeet

Similar Messages

  • TS3276 Anyone experiencing problems sending mail using TalkTalk - can receive but not send  - was ok up until pm 24/08/12 - have recently loaded Mountain Lion patch could this be the problem?

    Anyone experiencing problems sending mail using Apple Mail viaTalkTalk - can receive but not send  - was ok up until pm 24/08/12 - have recently loaded Mountain Lion patch could this be the problem?

    jag157 wrote:
    "I managed to solve the problem. Under smtp settings (mail preferences/accounts/edit smtp) I set the outgoing port to 25 (as recommended by Talktalk), no authentication (set to none) and unchecked SSL. I found that until I set the port to 25 and authentication to none I was unable to uncheck SSL. One I had done this I was able to send from my main email and other email adddresses set up under my account."
    Superb advice R&W!  My email sending block using TalkTalk started 2 months ago using Snow Leopard, continued when I upgraded to 10.8.2, and has been persistent on my wife's new iPad (IOS 6.1).  Implementing your wise words has fixed all that, and now enables me to call her on FaceTime — previously only she could call me.  Thank you so much; this will save hours of further fruitless searching and phoning.
    Please remember that your email is now insecure, if you wish to have a secure connection SSL must be on and port 25 should be avoided.

  • Problem Sending Mail (using Mail 2.1.1) from Cafes with Wireless Internet

    Hi,
    I have a Comcast.net mail account and Cable Internet at home. Receiving and sending mail works perfectly.
    When I take my MacBook into any cafe that has wireless internet -- and I've tried this in multiple cities -- I can receive mail fine, but when I try to send mail I get an error. The error message doesn't seem to have anything of use in it -- just "Cannot send the message with server smtp.comcast.net."
    When I then take the MacBook home, it instantly sends all the emails with no problem.
    Any ideas?
    Thanks.

    Hello Ron.
    > I know that some ISP's require authentication when using their servers from outside their network.
    It isn't your ISP that may require authentication with their SMTP server when connected to the internet via a different ISP, it is the ISP used for connecting to the internet if different from your own that dictates or may require this. If your ISP or the email account provider for the account does not support separate authentication with their SMTP server, trying to use authentication for the SMTP server will not work.
    Is Comcast your ISP? If not, is your ISP's SMTP server authenticated and does your ISP support using or not using separate authentication with their SMTP server?
    Time Warner (RoadRunner) is my ISP and RR does not have have an authenticated SMTP nor do they support it.

  • Problems sending mail using my .me account

    Hi, I just started using Lion and my mail (mobileme account) freezes when sending mail. Do I need to change the settings in the mail preferences pane?

    You don't need any of that socket factory stuff. See the JavaMail FAQ for a simpler way
    to do it. See also the smtpsend.java demo program for a simple way to switch between
    using SSL and not using SSL.

  • Problem sending mail using imap

    Just switched my gmail account in Entourage to an imap so it would sync with my iphone, and now it won't send any mail out. Just stays in outbox until it times out. Also, my At&t account won't send out either, and that's still a POP.

    In Mail>Preferences>Accounts, highlight that one, Account Information tab, near the bottom, Outgoing Mail Server (SMTP), Server Settings... button.
    Does the top say exactly smtp.gmail.com, or does it have an @ sign in it?

  • I have a problem sending mail via smtp. I use a satellite system and the average return time for a ping is 675ms. Is this a problem with mail? If so can I change Mail to accept it. The problem also exists with Lion

    I have a problem sending mail via smtp. I use a satellite system and the average return time for a ping is 675ms. Is this a problem with mail? If so can I change Mail to accept it. The problem also exists with Lion and on both my MacPro and my wife's Imac. I also see my mailboxes randomly disconnecting and reconnecting. Any other ideas of a possible cause?

    I solved it myself, after the "note" which came back from FF/Mozilla just as I finished my message, commenting on what it was that my system had , I wnnt back to check my plug-ins etc. I downloaded the latest Java, BOTH 32bit AND 64 bit versions and latest Firefox.
    Now all is working.
    Thanks,
    B.

  • Problems to SEND MAIL using WWV_FLOW_MAIL.SEND - APEX_MAIL

    I tried send mail using the code below
    DECLARE
    l_body      CLOB:= EMPTY_CLOB;
    l_body_html CLOB:= EMPTY_CLOB;
    BEGIN
    wwv_flow_api.set_security_group_id;
    l_body :='<html>
    +<head>+
    +<style type="text/css">+
    +body{font-family: Arial, Helvetica, sans-serif;+
                                   +font-size:10pt;+
                                   +margin:30px;+
                                   +background-color:#ffffff;}+
    +span.sig{font-style:italic;+
    font-weight:bold;
    color:#811919;}
    +</style>+
    +</head>+
    +<body>+
    +</html>';+
    l_body_html := '<html>
    +<head>+
    +<style type="text/css">+
    +body{font-family: Arial, Helvetica, sans-serif;+
                                   +font-size:10pt;+
                                   +margin:30px;+
                                   +background-color:#ffffff;}+
    +span.sig{font-style:italic;+
    font-weight:bold;
    color:#811919;}
    +</style>+
    +</head>+
    +<body>+
    +</html>';+
    wwv_flow_mail.send('[email protected]','[email protected]',nvl(l_body,'Texto com erro'),nvl(l_body_html,'erro2'),'K','[email protected]',
    +'[email protected]','[email protected]');+
    wwv_flow_mail.push_queue;
    END;
    +/+
    This code return the message:
    Mail To From Subject CC BCC Created On Created By Error Created
    CHECK$01 [email protected] [email protected] K [email protected] [email protected] 08/23/2010 03:05:00 PM SYS
    ORA-06502: PL/SQL: erro: erro de conversão de caractere em número numérico ou de valor
    Follow my mail settings
    SMTP Host Address : POP.SLE.TERRA.COM.BR
    SMTP Host Port 110
    Administration Email Address [email protected]
    Notification Email Address [email protected]
    what´s wrong ?

    I would try sending just basic text first, then move on to getting your other pieces dynamics. The very last step to me would be the email body.
    Here is an example of a basic text email I use:
    declare
      e_id        NUMBER;
      c_id        NUMBER;
      emp_nm      VARCHAR2(100);
      clrk_id     NUMBER;
      e_clrk      VARCHAR2(47);
      e_org       NUMBER;
      e_sender    VARCHAR2(50);
      e_recip_lst VARCHAR2(255); 
      e_cc        VARCHAR2(100);
      e_bcc       VARCHAR2(100);
      e_subj      VARCHAR2(50);
      e_msg_ln1   VARCHAR2(100);
      e_msg_ln2   VARCHAR2(100);
      e_msg_ln3   VARCHAR2(100);
      e_msg_ln4   VARCHAR2(100);
      e_msg_ln5   VARCHAR2(100);
      e_msg       VARCHAR2(1000);
      CRLF        CHAR(2) := CHR(13) || CHR(11);
      tmp_flag    NUMBER;
    begin
       if :P2_INJURY_FLAG = 1 then
       -- find out if it has changed first so we don't keep sending emails
        select injury_flag, VEH_LOC
          into tmp_flag, e_org
          from APPS.tc
         where tc_id = :P2_TC_ID;
       if :P2_injury_flag <> tmp_flag then
        begin
           select FN_GET_USER(nvl(v('APP_USER'),user))
             into clrk_id 
             from dual;
          select ADMIN_USERNAME
             into e_clrk
            from APPS.APEX_ACCESS_CONTROL
           where ID = clrk_id;
        exception
           when others then null; -- in case we cannot find the user
        end;
        e_id          :=  :P2_EMP_ID;
        c_id          :=  :P2_TC_ID;
        select EMP_FNAME ||' '|| EMP_MNAME ||' '|| EMP_LNAME into emp_nm
          from APPS.EMPLOYEES
         where EMP_ID = e_id;  --
        select RECIPIENTS, CC, BCC
          into e_recip_lst, e_cc, e_bcc
          from APPS.SAFETY_NOTIFICATIONS
         where ORG_ID = e_org;  --
          e_sender    :=  '[email protected]';
          e_subj      :=  'Loss Reported';
          e_msg_ln1   :=  'Employee: ' || emp_nm || ' (' || e_id || ')'  
                          || CRLF;
          e_msg_ln2   :=  'Was reported as sustaining a loss' || CRLF;
          e_msg_ln3   :=  'by ' || e_clrk ||CRLF;
          e_msg_ln4   :=  CRLF;
          e_msg_ln5   :=  'Sent ' || to_char(sysdate,'MONTH DD,YYYY HH:MI AM');
          e_msg       :=  e_msg_ln1 || e_msg_ln2 || e_msg_ln3 || e_msg_ln4 || e_msg_ln5 || CRLF || e_recip_lst;
         utl_mail.send(
           sender => e_sender,
           recipients => e_recip_lst,
           cc => e_cc,
           bcc => e_bcc,
           subject => e_subj,
           message => e_msg);
      end if;
    end if;
    end;

  • Problem sending Mail

    I am having problem sending mail in Outlook (not using express). I receive mail no problem at all and I don't want to change account to IMAP to send mail. So what are my options to make this work using Outllok?

    Who is your internet service provider used for connecting to the internet?
    Are you also accessing an email account and SMTP server provided by your ISP and if so, can you send messages with this account?
    Does GoDaddy provide/support an authenticated SMTP server?
    Which server port are you using for this SMTP server - 25, 587 or something else?

  • Cannot Send Mail using AIM account.

    I can receive mail fine but when I try to send mail I get the following message:
    Cannot send mail using the server smtp.aim.com:EmilyLozano.
    Use the pop-up menu below to try a different outgoing mail server. All messages will use this server until you quit Mail or change your network settings.
    Message from: Emily Lozano <[email protected]>
    I left for a trip a few days ago, came back and now for no apparent reason cannot send mail as I always have. I have reconfigured the port to 587 and that did not help. Any suggestions? (I can send and receive fine via the web, but I really hate it.)

    I'm glad you got it figured out. So many times people on this forum sit around waiting for help when they could have retraced their steps, like you did, to figure out the source of the problem.

  • Unable to SEND mail using Activesync in Exchange 2010 server on iPhone or Windows Mobile 6.1

    Hi All,
    We've been setting up a new SBS 2011 server for a client this week. Everything is working, except the staff have 4 x iPhones to connect with Exchange ActiveSync.
    There are 2 x iPhone 4's and 2 x iPhone 3Gs's. We can setup the Exchange accounts on each of the phones and they are all able to sync mail and calender etc with the server.
    The problem we have is when any of them try to send mail from the phone, it gives an error : "Cannot Send Mail - An error occurred while delivering this message" and it sits in the outbox on the phone.
    The newsgroups and forums are littered with people having issues with IOS4 and Exchange 2010 but most of these are from June-August 2010 when IOS4 version was around 4.00 or 4.01
    A lot of these people had iPhone 3 handsets running with IOS 3.1.3 which worked with Exchange 2010 but when they upgraded to IOS 4, they had this problem sending mail.
    It seems that for most of them, the fix came in the form of IOS version 4.1 which fixed the send issue for them.
    We have a variety of Hansets and IOS versions (including an iPhone 3Gs running IOS 3.1.3) but are unable to send mail from any of them:
    iPhone 3Gs    IOS 3.1.3
    iPhone 3Gs    IOS 4.3.3
    iPhone 4       IOS 4.3.3
    iPhone 4       IOS 4.3.5
    I was surprised that the iPhone 3Gs running 3.1.3 was unable to send either as nearly all the forums etc I read with this issue said the iPhone 3's worked with that IOS version.
    Today we used a test iPhone 4 handset from our office to connect to an almost identical Small Business Server 2011 we setup two weeks ago for another client.
    The test iPhone 4 was able to connect, Sync and Send email on that server but when set it to connect to this SBS 2011 server, it gets the "Cannot Send Mail" message the same as the others. So clearly the handset is working (on the other server at least),
    it must be something misconfigured in this Exchange server right?
    We ran the Exchange Remote Connectivity Analyser on the Exchange server and got green ticks across the board.
    Outlook Web App and Outlook Anywhere both work normally. Everything we can test on the Exchange server works except sending from any iPhone.
    Having said all that, I just setup a Windows Mobile 6.1 handset to sync with the Exchange 2010 server as a test, and it appears to have the same issue.
    It will connect & Sync Mail, Contacts and Calendar but if trying to send an email from the phone, it will just sit in the outbox.
    Does anyone have some insight into what the problem may be?

    Further to this .. I found the solution on a MS Exchange 2010 support forum.
    It was not a certificate or firewall issue, looks as thought the “Accepted Domains” in Exchange Mgmt Console –
    Org Config – Hub Transport cannot have any spaces in the name field.
    I had some spaces and the emails were not downloading fully and able to send. Once I removed the spaces from the Name field and
    restarting the Exchange and IIS services emails were now being sent and received ok.
     Check
    out :
    http://social.technet.microsoft.com/Forums/en-US/exchangesvrmobility/thread/321eae51-9cbd-4a5e-85c1-68d8f7b523c3
     This
    is good one to add to your knowledge bank in case you come across it in the future.
    Rgds Gerry

  • Send mail using Internal Mail server doesn't work

    I can't send mail using my companies mail server, which requires authentication and port 587 to send.  We have a valid, non self-signed SSL certificate so that is not the issue.  I can send mail using Bell's mail server but that violates our regulatory compliance obligations. 
    The server using POP3 and one must login to get mail as well as send.  Unfortunately there is no otehr error message than the: error sending "mail subject".  No further details are provided and when we check the mail servers logs its clear the Pre isn't even attempting to connect to the mail server.  So the request to send mail isn't even being sent out.  That could be an issue with the Pre or with Bell but Bell support will only troubleshoot to the point of fidning out if you can send using their mail server.  We can so their support stops at that point.
    I still have v1.3.1 of the WebOS as v1.3.5 doesn't seem to be out for the Bell Pre's yet.  But from what I've read v1.3.5 is even worse at handling mail not better.  However, there may be a solution out there to this beyond sending the Pre's back (I doubt we can) as Balckberry's and iPhone's don't have this issue.
    Any advice is greatly appreciated.
    Post relates to: Pre p100eww (Bell)

    Further update on this problem.  It does send if I use TLS instead of SSL so that must mean that the Palm Pre doesn't use SSLv3 or higher.  As TLS is a viable security setting option to maintain compliance I can use that.  But still Plam should seriously consider upgrading tis SSL versioning.

  • Problem sending mail over GPRS/EDGE

    problem sending mail over GPRS/EDGE
    i am in thailand right now with my iPhone 3G 16 GB (italian, no SIM-lock, 2.2). my problem: the iPhone does not send emails via GPRS/EDGE of local AIS mobile provider (there is no 3G in thailand right now). each time i try, i will get a prompt saying 'cannot send mail, the connection to the outgoing server "mail.gmx.net" failed'.
    in germany, i use a contract SIM from o2, in thailand a prepaid SIM from AIS. i have configured 2 german pop mail accounts on my phone (gmx.de, o2online.de). receiving and sending email work fine on WLAN (everywhere, also here in thailand) and in germany on 3G/EDGE/GPRS. internet works everywhere, too. so, configuration seems to be okay. for each account, i use the same (smtp) sending server for all networks (ie i do not change configurations, using mail.gmx.net and pop.o2online.de). for a test, i changed smtp server to the AIS proprietary server mail.cscoms.com, but no change in behaviour.
    so, any ideas how i can get my iPhone to not only receive but also send emails via GPRS of AIS?
    thank you!

    ok. i found the solution.
    The problem is not in the iphone, the problem was DNS resolution in the server side.

  • What is an smpt password?  I have problems sending photos using the stamp at the bottom because it asks for some smpt password and I have no clue to find out what it is, how to set one of find one if I somehow put one in and don't know what it it.

    what is an smpt password?  I have problems sending photos using the stamp at the bottom because it asks for some smpt password and I have no clue to find out what it is, how to set one of find one if I somehow put one in and don't know what it it.

    It's the password for your outgoing mail in your Mail account. You need to set it up in your Preferences.
    Regards
    TD

  • Outgoing server port configuring not in Mail 3.5 - problems sending mail?

    I recently upgraded from Tiger to Leopard and one of the things I noticed is that in Mail 3.5 undere Mail>Preferences>Accounts under the Account Information tab, there is no longer the ability to select or change ports for the Outgoing Server.
    In Mail 2.x, there was an Advanced button that would let you choose a different port and select SSL (or not). In Mail 3.5, this feature is missing. Does anyone know if the outgoing server port can be changed? The reason I ask is that when I travel, my ISP will not accept any of my outgoing mail because I'm not using my home IP address (especially with .mac). This is usually remedied by changing to a different, less common port for the outgoing server. If I'm unable to change outgoing server ports in Mail 3.5, is this going to cause problems sending mail when I'm on the road? Any help would be appreciated. Thanks.
    Ed

    If you pull down the bar in the outgoing mail server, you should be able to select "edit server list" and the window shows up where you can set up port.

  • Problems sending mail in differents instances

    Hi everyone!
    I have a strange problem when my Portal application (JSPDynpage) try to send mail using the exchange server - note: this server works fine when I send a mail by collaboration-
    In DEV instance, the same application works fine and the mails are sending without problems, but... in QA this exceptions occurs:
    Sending failed; nested exception is: javax.mail.AuthenticationFailedException
    It is so strange, because, is the same Portal App, the same Exchange server, and the same users (from, to), the only difference are the instances: DEV / QA
    Any Idea??
    any suggest??
    this is the code:
    try{
      Properties props = System.getProperties();
      props.put("mail.smtp.host", "x.x.x.x");
      props.put("mail.smtp.auth", "true");
      Session session = Session.getDefaultInstance(props, null);
      com.sap.security.api.IUser User = UMFactory.getUserFactory().getUserByLogonID(iuser.getId());
      MimeMessage message = new MimeMessage(session);
      message.setFrom(new InternetAddress(User.getEmail()));
      message.addRecipient(Message.RecipientType.TO, new InternetAddress(toAdmin));
      message.setSubject("Inscripción a Curso ");
      message.setText("blablabla");
      Transport.send( message );
      catch(Exception ex){
         error = "Error enviando mail : "+ex.getMessage();
    thanks in advance.
    it is very urgent, I promise points
    Leslie.-

    Hi Leslie,
    Transport.send( message );
    can only use with no authentification. Otherwise you need this code :
    if(auth)
        Transport transport = session.getTransport("smtp");
        transport.connect(smtpHost,smtpLogin,smtpPassword);
        message.saveChanges();
        transport.sendMessage(message, message.getAllRecipients());
        transport.close();
    else
        Transport.send(message);
    Best regards,
    Mathieu

Maybe you are looking for