SMTP Server Changing Unpredictably

I am experiencing weird behavior in my JavaMail program. At first, mail sending works fine through a remote mail server. After the program has been running for a while, though, it starts trying to send messages through localhost.
I am creating my session once as follows and use it and only it for all mail handling in my program:
    Properties properties = System.getProperties();
    properties.put("mail.smtp.host", smtpHost);
    properties.put("mail.smtp.auth", "true");
    // Disable the TOP command.  Otherwise, JavaMail will raise an
    // exception in calls to folder.fetch() and message.getContent()
    // when dealing with a qmail server and messages that begin with
    // a dot.  See
    //   http://forum.java.sun.com/thread.jspa?messageID=4395487?
    // for details.
    properties.put("mail.pop3.disabletop", "true");
    Authenticator authenticator = new FixedAuthenticator(userName, password);
    Session session = Session.getInstance(properties, authenticator);I create a message to send as follows:
    MimeMessage mimeMessage = new MimeMessage(session);
    toAddresses = InternetAddress.parse(to, false);
    mimeMessage.setRecipients(Message.RecipientType.TO, toAddresses);
    ccAddresses = InternetAddress.parse(cc, false);
    mimeMessage.setRecipients(Message.RecipientType.CC, ccAddresses);
    mimeMessage.setSubject(subject);
    InternetAddress fromAddress = new InternetAddress(from);
    mimeMessage.setFrom(fromAddress);
    Address replyToAddresses[] = { new InternetAddress(replyTo) };
    mimeMessage.setReplyTo(replyToAddresses);
    DataHandler dataHandler = createDataHandler(inputStream, contentType);
    mimeMessage.setDataHandler(dataHandler);I send the message as follows:
    Transport.send(mimeMessage);I dug around in this forum's archives and found various references to multithreaded apps having this problem due to use of statics and system properties. I'm thinking I can fix the problem by getting an instance of the Transport class from the Session and sending the message through it instead of calling the static Transport.send() method. Sound right? Or do I also have to change the way I'm setting up the Properties object?

Here is my thinking, which may or may not be valid:
1. My POP3 server is establishing connections with
SMTP servers on the SMTP port.
2. When my app (running on the same machine as the
POP3 server) tries to send mail using a remote SMTP
server, the app needs to open the SMTP port that is
already tied up by the POP3 server.You would have to be doing something very unusual for that
to happen. The client port is assigned arbitrarily and is unrelated
to the server port you're connecting to. Two clients using different
client ports can connect to the same server port on the same server.
3. In response to the busy SMTP port, somehow
JavaMail is somehow retrying the send using the
default SMTP server (localhost).No, it doesn't do that.

Similar Messages

  • SMTP Server changes on Mac now causing error "remapping record identifiers"

    I had some problems all of a sudden with outgoing smtp server settings as I traveled from place to place. I finally got all that resolved through trial and error. Now when I sync my iPhone, it tells me "iTunes could not sync mail accounts to the iPhone "my name" because an error occurred remapping record identifiers. iPhone mail is working fine. Did the smtp server setting changes cause this? How do I fix it? Would appreciate your comments and suggestions.

    Check Damon's answer in this thread.
    http://discussions.apple.com/thread.jspa?messageID=6073736
    Did you make these changes on your iPhone, or with the Mail.app on your MBP?
    FYI - the sync process for email account setup information in a transfer process in one direction only - from your computer to your iPhone. Any changes made to account settings on your iPhone will not be transferred to your Mac. Email account settings are not synced.
    If you made the changes to the account settings on your iPhone only, the changed settings will be overwritten with the account settings on your Mac when syncing. Transferring email account settings via the sync process only needs to be done once - unless you make changes to the account settings on your computer that you want transferred to your iPhone - without having to manually change the account settings on your iPhone.

  • Outlook 2011 quit sending email - iCloud SMTP server changed?

    Anybody else notice that SMTP parameters to connect to Apple's iCloud mail servers have changed?
    I use Outlook 2011 for Mac for my email client under 10.6.8. and today I noticed that my outgoing mail from Outlook on my iCloud mail account was hanging up and timing out connecting to Apple's SMTP servers.  Had not seen this problem before.  The same messages were sent successfully through Mail.app.  What was the difference?
    It turns out that the outgoing server name used by Outlook - previously smtp.me.com - needed to be changed to smtp.mail.me.com and I also needed to use the alternate port 587.   I had used the previous settings successfully as recently as last week but it wasn't working this morning, so the change must have been only in the last few days.
    Hope this helps somebody else who's frustrated trying to keep their Outlook email functioning on Apple's servers.

    Hi paulfrom34,
    Welcome to the Apple Support Communities!
    I understand that you are unable to send email on your Mac unless you use your iCloud account. To troubleshoot issues with sending email, please read over and work through the suggested steps located in the attached article. 
    If you can’t send or receive email on your Mac - Apple Support
    Best regards,
    Joe

  • Mail SMTP-server changing the port by itself!

    Hi!
    My mail app keeps changing the smtp port from 25 to 547! I dont know how i can fix this..! It happens even though i havent put my macbook pro to sleep, over intervals of a couple of hours. Ive assigned mail to use a custom port 25 because for some reason it doesnt use port 25 when assigned to "Use default ports"..
    Any ideas of how to fix? Couldnt find any case like it on the interwebs.. :/
    -Tormod

    Hi!
    I have my own domain, so port 25 works for that mailaccount, none of the others..

  • How do I change the primary SMTP server address on my iPhone DOT-MAC accoun

    My original account smtp settings were for dot-mac. I am having ever increasing problems getting mail to send. I can find the settings for my primary SMTP server, but cannot edit or update them (currently smtp.mac.com), as they are all gray'd out and cannot be changed. I would like to update these settings to smpt.me.com. Is it necessary for me to delete this account in order to update the settings? That seems rather lame.

    What did not work? You could not add an additional SMTP server? It does not matter what the primary is listed as....turn it off. Then turn on the additional server you added.
    Better yet remove your .mac account and add it back as .me account.
    .Mac to MobileMe transition FAQ
    http://support.apple.com/kb/HT1932
    Message was edited by: iphone3Gguy

  • How do i change primary smtp server?

    How do I change my primary smtp server? I can delete all the old accounts I no longer use as email accounts, but the primary smtp server for the accounts I still use is still set as that for the old server. Not only is there nowhere to delete it, I can't even change it! There should at least be a button to take you to that page in the iOS6 settings somewhere easy to find, like IN the same place as where it is listed.
    Very annoying.

    What did not work? You could not add an additional SMTP server? It does not matter what the primary is listed as....turn it off. Then turn on the additional server you added.
    Better yet remove your .mac account and add it back as .me account.
    .Mac to MobileMe transition FAQ
    http://support.apple.com/kb/HT1932
    Message was edited by: iphone3Gguy

  • Can I change the smtp server with Yahoo push account?

    My yahoo email account will send and receive over EDGE using the default yahoo mail settings. On my home Cox internet WiFi network I can retrieve messages but cannot send. When sending it says it was sent and makes the "swooshing" mail sent sound, but the message disappears. It does not appear in the "sent" folder or "drafts" folder either. No error message is returned.
    I suspect this is related to Cox blocking the smtp server, but the iPhone does not allow me to change the smtp settings on the default yahoo account. Does anyone know how to do this? I can set it up manually for POP access, but then I'm flooded with spam.

    No, you cannot change the SMTP server on the Yahoo push account.
    Yahoo push only works if you configure your account using the Yahoo! Mail shortcut on the iPhone, and that shortcut does not allow for ANY customization.

  • LMS 3.2.1 changing smtp server

    Running lms 3.2.1   CS 3.3.1  on Windows 2003
    I need to point the LMS server to a new mail relay, but when I make the change in
    CS->SERVER->Admin->System Preferences  smtp server
    It claims to have made the change successfully but the old IP address remains.
    I made a successfull change days before.  Any help/thoughts appreciated?

    Afroj,
              Thank You for the response.  Unfortunately I am unable to provide the regdaemon.xml as this is a closed system.
    The  regdaemon.xml file shows the old ip address that is displayed in the gui, however when I try to update it through the gui, the smtp.log shows successfull validation of the smtp service using the updated ip address.
    I understand that this may not be resolvable without me providing this file and I can open a TAC case if necessary.
    Can I edit the regdaemon.xml file directly to replace the ip address?

  • Where(How to change the SMTP- Server

    Hello,
    i'm using the OAS 10.1.2.0.2
    While installation OAS i entered the name of the actual working SMTP- Server.
    Sending mails worked fine until today.
    Now the name of the SMTP- Server has changed and i wanted to change it(the name) in the Application Server, but i didn't find one/all place(s) where i had to change the name(s) of the SMTP- Server.
    Is there anyone who can help me??
    Thanks a lot.
    Best regards.
    Florian

    Refer this:
    http://download.oracle.com/docs/cd/B14099_19/core.1012/b13995/reconfig.htm#sthref681
    Thanks
    Shail

  • Changing Oracle XE SMTP server.

    I am running Oracle XE on Vista Home Basic and as you may expect this version of Vista doesn't run SMTP or WWW server. Anyways, I wanted to use a remote SMTP sever, say smtp.mydomain.com. I found where to change the default SMTP server from "localhost" to "smtp.mydomain.com" - it is on
    Home>Application Builder>Application Administration>Email Configuration>Email Environment Settings
    the problem is that my SMTP server requires autentication and I see no place where to enter the user name and password. Can somebody help me with this?
    George

    You can achieve your objectives by using the UTL_SMTP package.
    UTL_SMTP
    {message:id=1320165}
    {message:id=3416587}
    {thread:id=288758}
    {message:id=3649012}
    {message:id=1426409}
    {message:id=932565}
    Regards,
    PhiriAPEX SMTP Search Reults<a/>
    {message:id=1320165}
    {message:id=3416587}
    {thread:id=288758}
    {message:id=3649012}
    {message:id=1426409}
    {message:id=932565}
    Regards,
    Phiri

  • Why doesn't the smtp (outgoing mail server) change on switch locations

    It would seem to me that when you choose Apple, locations and then select a new location, the Mail program should know that it should use the new smtp server.
    I have dsl from at&t or the old southwestern bell. They have blocked sending to any other smtp server on port 25 while I am at my home.
    I know how to switch them and recieve the prompt when it fails to select a different server. I know how to do this. However, other people who I have converted to the Apple platform, are displeased that it doesn't know to switch. This person is not technical and doesn't want to be technical.
    In their terms, they just want it to work.
    For right now, I told her to go into preferences, accounts within mail and to switch back and forth. I told her I would find a better solution.
    discussions.apple.com shows a lot of people complaining about outgoing mail but not a lot of solutions on switching back and forth.
    Anybody have any suggestions? I still think that when you switch the location, it should change your outbound smtp server.
    SWP

    You might want to take a look at Location X.

  • I changed my password on my aol account but it did not change on the SMTP server which is preventing me from answering email.  Help

    I changed my aol password but the SMTP server password did not change so I can't send mail.  How can I change the SMTP password?

    Go into Settings > Mail, Contacts, Calendars and select the account, then tap the account on the popup that you should get, and then tap on the SMTP server name

  • TS3899 how do i change the password on my primary smtp server

    i had to change my email password,
    now my primary smtp server password needs changed.
    I can read it but not change it or edit it.
    how do I change my primary smtp server password

    Delete the account and add it back.

  • Changing verizon primary smtp server??

    hi,
    i'd like to change the primary smtp server for my verizon email.
    it's currently set to : outgoing.verizon.net
    and according to a recent email from verizon, i should change it to|
    smtp.verizon.net
    (all the other info doesn't change (passwords, ports, etc)
    if i tweak the primary smtp server and change the hostname from 'outgoing' to 'smtp'
    then hit 'done', the settings app crashes and doesn't update the settings.
    any help would be appreciated,since i can currently recieve mail, but can't reply on that account!
    lcubed
    iphone 5/ios 6.1.3

    This probably means that your mail app data are corrupted. First, try resetting the phone by holding the HOME and SLEEP buttons until an Apple logo appears. The try to change the setting again. If it still fails, delete the Verizon account, Reset the phone again, and add the account back.

  • The mailbox I set up has suddenly change the outgoing SMTP server to offline. Whatever I do I cannot edit it to become online

    the mailbox I set up has suddenly change the outgoing SMTP server to offline. Whatever I do I cannot edit it to become online

    Hello Jeba1969
    Use Connection Doctor to see what is causing it to be offline, like a incorrect password or a different setting for authentication. Check out the article below to get a start on troubleshooting your issues with sending mail.
    OS X Mail: Troubleshooting sending and receiving email messages
    http://support.apple.com/kb/ts3276
    Mail Setup Assistant
    http://www.apple.com/support/macosx/mailassistant/
    Regards,
    -Norm G.

Maybe you are looking for

  • How to display data collected in main vi to indicators in another vi

    Hi, I am collecting data using NI 6251 USB DAQ in the main vi but as i have too many controls and indicators on the main vi front panel. so i want to display the indicators(graphs) in another vi. i also want the vi with the graphs to open automatical

  • How do I transfer iTunes library from pc to iPad through iCloud?

    How do I transfer iTunes library from pc to iPad through iCloud when pc is setup for iCloud?

  • BAPI_ACC_INVOICE_RECEIPT_POST for vendor invoice posting

    Hi , I am using  BAPI_ACC_INVOICE_RECEIPT_POST for vendor invoice posting, I have made the header , and account paybale table , can any body give link for the sample code or give me sample code.

  • Updating Mobileme Gallery with iPhoto Library

    I have been using my mobileme gallery to publish photos and to let my friends upload their photos as well. The problem is that when they upload their photos, I am able to see them in my Mobileme gallery, but I am not able to import them to my Library

  • Can't use

    Hello all.. I have been using Solaris 10 for a few weeks now, and I really like it :-).. But, I am having this problem that has really stumped me, so if you could help it would be greatly appreciated. I can't use "localhost:<port #> to connect to my