Do i need to authenticate when using my mail server

I am trying to send an email using my mail server who i have an account with. When i run the code it returns a connection timed out and could not connect to SMTP host. Do i need to specify my username or password if so how do i do this.
This is my code Thanks in advance
import javax.mail.*;
import javax.mail.internet.*;
import java.util.*;
public class PostMail{
public static void postMail( String subject, String message , String from) throws MessagingException
     String recipients[ ] = {"[email protected]"};
boolean debug = false;
//Set the host smtp address
Properties props = new Properties();
props.put("mail.smtp.host", "mail.btopenworld.com");
// create some properties and get the default Session
Session session = Session.getDefaultInstance(props, null);
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);
// Optional : You can also set your custom headers in the Email if you Want
msg.addHeader("MyHeaderName", "myHeaderValue");
// Setting the Subject and Content Type
msg.setSubject(subject);
msg.setContent(message, "text/plain");
Transport.send(msg);
public static void main(String[] arsg) throws Exception{
     postMail( "Test", "Test", "[email protected]");
     System.out.println("Done");
     System.exit(1);

It depends on your mail server. Most mailservers dont expect you to authenticate while a few do. First, try to telnet to your mail server using the telnet utility.
telnet <mailserver address> <smtp port - 25>
220 blah blah blah...
HELO <your name - dont mind give anything here>
250 blah blah blah....
MAIL FROM <your address>
250 Sender Ok....
RCPT TO <your friend's address>
250 Recipient Ok....
RSET
250 Reset Complete...
QUIT
221 Server closing connection....
If this is not what happens, then your mailserver requires authentication and I dont know how to do it. But from what seems to be the problem, I think you are not able to contact the mail server itself. When you do telnet to mailserver just see how long it takes to connect.

Similar Messages

  • Authenticate Users Using an LDAP Server

    Hi,
    I did implement 'Authenticate Users Using an LDAP Server' according the link blow below.
    [http://www.oracle.com/technology/products/database/application_express/howtos/how_to_ldap_authenticate.html]
    It works OK to specific DN String, example 'cn=%LDAP_USER%,OU=Menahel,OU=Cmp,DC=ho,DC=discount'.
    We have a lot of domain rules, mean the users not located at the same DN.
    Is it possibale to use general DN string (base root) like 'cn=%LDAP_USER%,*,*,DC=ho,DC=discount?
    Thanks in advance,
    Shay

    Augusto, one thing to check (since it caught me out) is that your LDAP entries conform to the right format, namely
    "cn=Bob" etc
    When I was integrating HTMLDB LDAP against a Sun One Directory Server, it had me scratching my head for ages, until I realised that the LDAP entries had been created in the format of -
    "uid=bob" rather than "cn=bob"
    This might not be your problem, but it's worth checking anyway ;)

  • I have a Mac Pro using OSX 10.7.4.  When using apple mail I click on the address icon to obtain email address and nothing happens.  I've restarted both the application and the Mac but still won't open address book.  Any ideas please.

    I have a Mac Pro using OSX 10.7.4.  When using apple mail I click on the address icon to obtain email address and nothing happens.  I've restarted both the application and the Mac but still won't open address book.  Any ideas please.

    Assuming you have these accounts set up in Mail, open preferences and under Accounts tab, edit the SMTP outgoing server list. Do you have a .mac address in the list? If so, delete it.
    Are you using iCloud?
    For the troubled account, select the correct SMTP server for that account in the box and check the box to use only that server with that account.

  • Controlling Access to Certain Reports When Using Crystal Reports Server

    Hi,
    I was wondering exactly how security is managed when using Crystal Reports Server?  Do you assign rights to individual reports via user ids in Active Directory?  Or what exactly is used for user authentication?  Is it possible to create local accounts?  Thanks.

    Usually access is controlled by permissions which are set in the CMC (BO web admin tool). You can map 3rd party groups from AD or LDAP and then assign permissions to those groups or set up security with built in enterprise groups as well. You may elect to use any combination of the above. For more complex security models there can use database and row level security built into our meta layers called business views and universes.
    Regards,
    Tim

  • Did IOS8 upgrade w/iPhone5 / lost names associated when using e-mail - only displaying telephone numbers / what are the steps to correct to show names?

    Did IOS8 upgrade w/iPhone5 / lost names associated when using e-mail - only displaying telephone numbers / what are the steps to correct to show names?

    maybe OP want to extract all numbers from his inbox using regular expressions?

  • Suggestion: to add the feature to expand the to/cc/bcc windows when using google mail.

    when using google mail, at the compose window can you add
    the capability to expand the size of the to/cc/bcc/ windows?
    Safari allows the expansion of the to/cc/bcc windows so one
    may see all the entries at a glance. TIA. wm king

    That capability will be added in Firefox 4.
    I see you have OS X 10.4 and a PPC Mac, unfortunately you will not be able to install Firefox 4 as it requires an Intel Mac and at least OS X 10.5. There is a third party build of Firefox 4 for the PPC and 10.4 available from http://www.floodgap.com/software/tenfourfox/

  • 3?'s: Message today warning lack of memory when using Word (files in Documents) something about "idisc not working" 2. Message week ago "Files not being backed up to Time Capsule"; 3. When using Mac Mail I'm prompted for password but none work TKS - J

    3 ?'s:
    1  Message today warning lack of memory when using Word (files in Documents) something about "idisc not working"
    2. Message week ago "Files not being backed up to Time Capsule";                                                                                                                                             
    3. When using Mac Mail I'm prompted for password but none work
    Thanks - J

    Thanks Allan for your quick response to my amateur questions.
    Allan:     I'm running version Mac OS X Version 10.6.8     PS Processor is 2.4 GHz Intel core 15 
    Memory  4 gb  1067   MHz  DDr3  TN And @ 1983-2011 Apple Inc.
    I just "Updated Software" as prompted.
    Thanks for helping me!    - John Garrett
    PS.
    Hardware Overview:
      Model Name:          MacBook Pro
      Model Identifier:          MacBookPro6,2
      Processor Name:          Intel Core i5
      Processor Speed:          2.4 GHz
      Number Of Processors:          1
      Total Number Of Cores:          2
      L2 Cache (per core):          256 KB
      L3 Cache:          3 MB
      Memory:          4 GB
      Processor Interconnect Speed:          4.8 GT/s
      Boot ROM Version:          MBP61.0057.B0C
      SMC Version (system):          1.58f17
      Serial Number (system):          W8*****AGU
      Hardware UUID:          *****
      Sudden Motion Sensor:
      State:          Enabled
    <Edited By Host>

  • When using a proxy server at work, Deezer page does not load normally?

    When using a proxy server at work, Deezer page does not load normally, but when I go home and use connection without proxy, everything is fine.
    It loads, and some features on the website work, but the look is not the same. Over the proxy it shows just text on the left side of the screen and I can't choose some of the options.
    When I go home and use my home connection without proxy, there are no problems, everything is OK.
    Could you please solve this?

    I found that after Firefox v29, a LOT of my settings and<BR>
    add-ons were changed / reset. Try this;
    '''''[https://support.mozilla.org/en-US/kb/troubleshoot-firefox-issues-using-safe-mode Start Firefox in Safe Mode]'''''
    <BR>While you are in safe mode;<BR>
    '''''Firefox Options > Advanced > General'''''.<BR>
    Look for and turn off '''Use Hardware Acceleration'''.<BR>
    Then check ALL of your settings. Browser and add-ons. Then restart.

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

  • What do I do when IPhoto says "mail server does not recognize user name/password?

    What do I do when IPhoto says "mail server does not recognize user name/password?

    Fixed by resetting my password to Apple's new protocol!  In my case, I had to add a capitol letter.
    Reset here:
    https://iforgot.apple.com/cgi-bin/WebObjects/DSiForgot.woa/wa/iforgot

  • Is there any database parameters we need to set when using DBMS_PARALLE_EXECUTE?

    Hi,
    I am using dbms_parallel_execute package to do some process, I call a procedure to do the some tasks and insert data using the chunks by sql. Here is my code, I am calling p_process procedure, I am using 11g 11.2.0.3.0 - 64 bit  on windows server.
    DBMS_PARALLEL_EXECUTE.CREATE_TASK ('process a');
      DBMS_PARALLEL_EXECUTE.CREATE_CHUNKS_BY_SQL (
          task_name => 'process a',
         sql_stmt => 'SELECT startid, endid FROM chng_chunks',
         by_rowid => FALSE);
            dbms_parallel_execute.run_task
            ( task_name      => 'process a',
              sql_stmt       => 'begin P_process( :start_id, :end_id ); end;',
              language_flag  => DBMS_SQL.NATIVE,
             parallel_level => 24 );
    This code runs very fast on a one database and I can see it uses lots of cpus but it runs very slow on a copy of the same database on another server which has more cpus and memory. I compare v$parameter vlues and those are pretty much  identical between databases. I checked the disk spaces and both servers has plenty of free space on disks.
    Now my question is, is there any other parameters that we need to set/check when using dbms_parallel_execute package.
    Thanks in advance.
    gg

    I don't get this. Ever. Why developers insist on comparing server1 with server2, simply because their code is running on both.
    It is like comparing the athletic ability of two persons, arguing that h/w wise they are the same (i.e. human), and both have green eyes (your same software). And as because these are all the same, both persons should be able to run the 100m in the same time.
    Yes, the analogy is silly.. as is the warped concept amongst many developers that server1 and server2 should exhibit the same performance when running the same code.
    It. Does. Not. Work. Like. That.
    Want to know why server2 is exhibiting the performance it does when running your code?
    Do that by ignoring server1 as it is NOT RELEVANT.
    Do that by examining the workloads and resource usage of server2, and the run and wait states of your code on server2.

  • Samba mount problem when using Oracle VM Server 2.1

    Hello
    I´m trying to mount a remote samba share from an Oracle VM Server 2.1 installation.
    To be able to do a mount.cifs, I installed samba-client manually using yum.
    yum repository based on Enterprise Linux 5 Update 1
    In the first step the mount failed with
    CIFS VFS: Server requests plain text password but client support disabled
    CIFS VFS: Send error in SessSetup = -13
    CIFS VFS: cifs_mount failed w/return code = -13
    After doing an
    echo 0x37 > /proc/fs/cifs/SecurityFlags
    the plain text password error message is gone.
    but
    CIFS VFS: Send error in SessSetup = -13
    CIFS VFS: cifs_mount failed w/return code = -13
    still exists.
    The mount command looks like that:
    mount.cifs //*servername*/*share* /mnt/*localdir* -o sec=none,user=*username*,pass=*password*
    The samba server which provides the share, only accept plain text password with no chance to get this adjusted.
    Is there anybody who knows how to fix this issue? Help would be really appreciated.

    [2008/02/08 14:58:07, 0]
    auth/pampass.c:smb_pam_passcheck(810)
    smb_pam_passcheck: PAM: smb_pam_auth failed - Rejecting User install !
    Which is an indicator that the password is transfered incorrectly.
    As the password is for sure correct, it seems to me that the sec=none option is not working correctly when using OVM 2.1.
    When using Enterprise Linux 5 Update 1 all is working well.
    There you did not even need to use the "echo 0x37"
    It works out of the box using sec=none mount option.
    That is also a reason why I started this post under Virtualization and not under Linux ;-)
    I assume it is a OVM 2.1 specific issue.

  • Assign the name of a file and its extension when using DESTYPE=MAIL

    Hello,
    I've developed a report running Oracle Reports 10g that is being emailed to a user. I would like to specify the name of the file and it's extension that is attached. Are there variables or parameters in Oracle Reports that I can use to accomplish this?
    It looks like by default that the file name is using the Name value found in the Property Inspector for the report. I have not been able to find a way to re-assign this value with a value from either the input or select values in the data model.
    Will Oracle Reports 10g allow me to define the name of the file and the extension?
    Any help or direction would be greatly appreciated.
    Thanks in advance
    Jesse
    Message was edited by:
    Sutherland

    Thank you for the quick reply and information. I almost thought you had solved my problem until I found out that distribution and bursting do not support delimited and spreadsheet output. One of the two files I need to email has a desformat of SPREADSHEET.
    Is there any other way to manipulate the file name and extension when using destype of MAIL?

  • Error while sending mail when using Java Mail API

    Hi Experts,
    I am trying to execute a webdynpro application which uses the Java Mail API to send emails. The exception that I get on executing the application is :
    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]
    Can anybody please help me sort out the issue.
    Regards
    Abdullah

    Hi,
    Usually one get this error if the SMTP server is configured not to relay mails (a security measure) or the SMTP server need the mail to be sent from a trusted IP or with proper authentication. Some SMTP servers are configured to block junk mails.
    Pls check with your  mail server administrator.
    Regards

  • Elements 10 organiser... CRASHES when using photo mail

    I select the photo, click next and program instantly crashes.
    Further email attachments does not work. Brings up an email window which i've not seen before and says no email account assigned. Yahoo is my default client.

    I’ve found it usually works best with web mail via Adobe after obtaining verification. I know some email services block bulk email completely and I’ve only tested it with Gmail which works fine. Should also work with other web mail e.g. Yahoo and Hotmail. Before you start it will help to check your internet security settings. If they are set to High, reduce the settings to Medium temporarily. Then follow these instructions.
    1. Log in to your mail provider on the web and add the following email to your address/contacts book.
    [email protected]
    2. Open Organizer and on the menu click:
    Edit >> Preferences >> Sharing
    3. Choose Adobe Email Service from the client dropdown menu.
    4. Add your name and email address to the fields provided and click OK
    5. Test the system (first use only)  by selecting a photo in organizer and choosing Share >> Photo Mail then click Next
    6. Choose a contact then click  Next
    7. Click Next Step, then click Next - the sender verification dialog will open.
    8. Check you have spelt your email address correctly and hit the Resend E-Mail button.
    9. Go to your inbox (also check spam) and when the Adobe mailer message is received copy (Ctrl+C) the long verification code.
    10. Return to the verification dialog and paste it (Ctrl+V) into the Sender verification field and click OK. Wait for validation confirmation then click OK to continue

Maybe you are looking for

  • Material Ageing

    Hi SAP Expert, i need to prepared functional spec for  Material Ageing Report. i'd like to have some samples for func spec (if any) ? and i would like to know if i what to prepared the functional   spec for Material Ageing Report , which table a invo

  • 20 user office - RV042 a solution for us?

    We have a 20-user office that needs a VPN firewall/router with NAT to access the Internet from their PC's and all 20 would like to work from home in the event of a snow storm. We have a T1 with a Ubigate iBG1000 from Covad that this would sit behind.

  • Gl balance on day  basis

    Hi freinds, If  I want to see GL Balance On day  or on particular date basis form which T-code I can get this.

  • Regarding Updating Unit of Measure using Recording

    Hi all, I have a requirement where I need to update the Unit of Measure values in the transaction MM02 using recording procedure. But I am getting problem with table control, if we have more than 11 values we need to use page down which is not workin

  • Cant fill a form (radio button)

    Hey. I frequently need to fill a form and I cant do so with my Ipad because at certain point I need to select an option with a radio button and the Ipad doesnt recognize it. The form also has square box and there I dont have a problem, I can check it