JavaMail: How to tell if SMTP server requires authentication

I am writing an application that sends notification emails. I have a configuration screen for the user to specify the SMTP hostname and optionally a username and password, and I want to validate the settings. Here is the code I am using to do this:
Properties props = new Properties();
props.put("mail.transport.protocol", "smtp");
if (mailUsername != null || mailPassword != null)
    props.put("mail.smtp.auth", "true");
Session session = Session.getInstance(props, null);
transport = session.getTransport();
transport.connect(mailHostname, mailUsername, mailPassword);
transport.close();This works if the user enters a username and password (whether they are valid or not), or if the username and password are empty but the SMTP server does not require authentication. However, if the server requires authentication and the username and password are empty, the call to transport.connect() succeeds, but the user will get an error later on when the app tries to actually send an email. I want to query the SMTP server to find out if authentication is required (not just supported), and inform the user when they are configuring the email settings. Is there any way to do this? I suppose I could try sending a test email to a dummy address, but I was hoping there would be a cleaner way.

Thanks for your help. This is what I ended up doing, and it seems to work. For anyone else interested, after the code above (before transport.close(), I try to send an empty email, which causes JavaMail to throw an IOException, which I ignore. If some other MessagingException occurs, then there is some other problem (authentication required, invalid from address, etc).
try
   // ...code from above...
   // Try sending an empty  message, which should fail with an
   // IOException if all other settings are correct.
   MimeMessage msg = new MimeMessage(session);
   if (mailFromAddress != null)
       msg.setFrom(new InternetAddress(mailFromAddress));
   msg.saveChanges();
   transport.sendMessage(msg,
       new InternetAddress[] {new InternetAddress("[email protected]")});
catch (MessagingException e)
    // IOException is expected, anything else (including subclasses
    // of IOException like UnknownHostException) is an error.
    if (!e.getNextException().getClass().equals(IOException.class))
        // Handle other exceptions
}Edited by: svattom on Jan 7, 2009 7:37 PM
Edited by: svattom on Jan 7, 2009 10:01 PM
Changed handling of subclasses of IOException like UnknownHostException

Similar Messages

  • Server requires authentication - How do I program for this?

    Hello,
    I'm testing out a webpage I have created that will be used to send email. I have DSL service...just recently subscribed. Previously I had Dial up. The server at that time didn't require authentication, but now that I have DSL it does. I'm a bit lost as to how to update my program (I've included the snippet in the post), so that it will run correctly. I am having some difficulty.
    My program looked like this :
    String POP3 = "pop.windstream.net";
    String SMTP = "smtp.windstream.net";
    // Specify the SMTP host
    Properties props = new Properties();                                           
    props.put(POP3, SMTP);
    // Create a mail session
    Session ssn = Session.getInstance(props, null);
    ssn.setDebug(true);                  
    //...html to make up the body of the message
    // set the from information
    InternetAddress from = new InternetAddress(emailaddress, fromName);
    // Set the to information
    InternetAddress to = new InternetAddress(EmailAddress2, toName);
    // Create the message
    Message msg = new MimeMessage(ssn);
    msg.setFrom(from);
    msg.addRecipient(Message.RecipientType.TO, to);
    msg.setSubject(emailsubject);
    msg.setContent(body, "text/html");                      
    Transport.send(msg);     
    //....                        I did some research already, and have looked at some other forum posts. The one thing I have noted when I run my program is that the dos prompt for tomcat is showing this:
    *DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smpt,com.sun.mail.smtp.SMTPTransport,Sun Microsystem, Inc]*
    DEBUG SMTP: useEhlo true, useAuth false
    DEBUG: SMTPTransport trying to connect to hose "localhost", port 25
    My ISP provider, Windstream, assures me that port 25 is NOT blocked. Also, I've noticed that useAuth is set to false, whereas the posts I have been looking at say true. It would make sense to me for it to be set to true in my case, since my server requires authentication. But how do I do that?
    I found this bit of information from another person's post :
    props.setProperty("mail.smtp.auth", "true");
    you also need an Authenticator like this
    Authenticator auth = new Authenticator() {
    private PasswordAuthentication pwdAuth = new PasswordAuthentication("myaccount", "mypassword");
    protected PasswordAuthentication getPasswordAuthentication() {
    pwdAuth;
    Session session = Session.getDefaultInstance(props, auth);*
    Post located at http://forums.sun.com/thread.jspa?forumID=43&threadID=537461
    From the FAQ section of JavaMail
    Q: When I try to send a message I get an error like SMTPSendFailedException: 530, Address requires authentication.
    A: You need to authenticate to your SMTP server. The package javadocs for the com.sun.mail.smtp package describe several methods to do this. The easiest is often to replace the call Transport.send(msg); with
    String protocol = "smtp";
    props.put("mail." + protocol + ".auth", "true");
    Transport t = session.getTransport(protocol);
    try {
    t.connect(username, password);
    t.sendMessage(msg, msg.getAllRecipients());
    } finally {
    t.close();
    You'll have to supply the appropriate username and password needed by your mail server. Note that you can change the protocol to "smtps" to make a secure connection over SSL.
    One thing I have noticed in the majority of the posts is that useAuth in the tomcat dos prompt should be set to true, and not false. Mine is coming up as false. Also, I think it should be set to true because the ISP's server requires authentication for sending and receiving email.
    Can you please provide me with some input on how to update my program so it will run?
    Thank you in advance:)

    Thank you for replying.
    Per your advice, I made these changes to my code:
    Properties props = new Properties();                                           
    props.setProperty("mail.smtp.auth", "true");               
    props.put("mail.pop3.host", POP3);
    props.put("mail.smtp.host", SMTP);
    Session ssn = Session.getInstance(props, null); The props.setProperty("mail.smtp.auth","true"); is something I found previously to posting my question. I'm assuming this is the line of code that has changed useAuth from false to true...is that correct?
    I'm most pleased to report that with the changes made above, my program works! But is my code good? As soon as I start taking on clients, I will need my code to be reliable, and it needs to work with Dial Up and DSL connections.
    With regards to your question about how I had found the authentication code but hadn't used it. Well, I did try it, again, this was previous to posting my question, and the compiler couldn't compile the program because of this statement - pwdAuth;
    I also tried this code I had found in the JavaMail FAQ section -
    String protocol = "smtp";
    props.put("mail." + protocol + ".auth", "true");
    Transport t = session.getTransport(protocol);
    try {
    t.connect(username, password);
    t.sendMessage(msg, msg.getAllRecipients());
    } finally {
    t.close();
    }But according to the compiler, t.connect(username,password); was not an available method. I checked the documentation and found that to be true. Do you have any suggestions? Looking into the documentation I find that there are 3 methods called connect that are inherited by the Transport class from javax.mail.Service.
    connect()
    connect(java.lang.String host, int port, java.lang.String user, java.lang.String password)
    connect(java.lang.String host, java.lang.String user, java.lang.String password)
    I would opt to try the third connect method, but what would I put for host?
    Thank you for helping me with this issue, I'm not an expert on using the JavaMail package, at least not yet, and I appreciate the help you have provided.

  • How to setup the SMTP server in Oracle apps?

    Hi,
    How to setup the SMTP server in Oracle Apps? Is it mandatory to keep the SMTP server on the same host where the Oracle data base is installed? Also can someone help how we can set up the SMTP server on different host (not the Database server) and we can use the same for Workflow notification mailer.
    Thanks,
    Bijoy
    Edited by: user12070886 on Feb 6, 2013 4:26 AM
    Edited by: user12070886 on Feb 6, 2013 4:27 AM

    How to setup the SMTP server in Oracle Apps? Is it mandatory to keep the SMTP server on the same host where the Oracle data base is installed? No, it is not mandatory. Also please note that the mails are sent out from concurrent manager mode. Not from the database node.
    Also can someone help how we can set up the SMTP server on different host (not the Database server) and we can use the same for Workflow notification mailer.
    >
    It depends on the operating system you are using. If you are using *nix then sendmail needs to be configured.
    Thanks

  • The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required.

     try
                    MailMessage mail = new MailMessage();
                    SmtpClient SmtpServer = new SmtpClient("smtp.gmail.com");
                    mail.From = new MailAddress("[email protected]");
                    mail.To.Add("[email protected]");
                    mail.Subject = "Test Mail..!!!!";
                    mail.Body = "mail with attachment";
                    System.Net.Mail.Attachment attachment;
                    attachment = new System.Net.Mail.Attachment(@"C:\Attachment.txt");
                    mail.Attachments.Add(attachment);
                    SmtpServer.Port = 587;
                    SmtpServer.UseDefaultCredentials = true;
                    SmtpServer.Credentials = new System.Net.NetworkCredential("userid", "Password");
                    SmtpServer.EnableSsl = true;
                    SmtpServer.Send(mail);
    Catch(Exception exception)
    When i m run this part of code it throw an Ecxeption                                                          
            Given Below is the Error.. 
        The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required.
    Bikky Kumar

     try
                    MailMessage mail = new MailMessage();
                    SmtpClient SmtpServer = new SmtpClient("smtp.gmail.com");
                    mail.From = new MailAddress("[email protected]");
                    mail.To.Add("[email protected]");
                    mail.Subject = "Test Mail..!!!!";
                    mail.Body = "mail with attachment";
                    System.Net.Mail.Attachment attachment;
                    attachment = new System.Net.Mail.Attachment(@"C:\Attachment.txt");
                    mail.Attachments.Add(attachment);
                    SmtpServer.Port = 587;
    SmtpServer.UseDefaultCredentials = true;    ///Set it to false, or remove this line
                    SmtpServer.Credentials = new System.Net.NetworkCredential("userid", "Password");
                    SmtpServer.EnableSsl = true;
                    SmtpServer.Send(mail);
    Catch(Exception exception)
    Given Below is the Error..      The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required.
    Solution:
    The error might occur due to following cases.
    case 1: when the password is wrong
    case 2: when you try to login from some App
    case 3: when you try to login from the domain other than your time zone/domain/computer (This
    is the case in most of scenarios when sending mail from code)
    There is a solution for each
    solution for case 1: Enter the correct password.
    Recomended: solution for case 2: go to
    security settings at the following link https://www.google.com/settings/security/lesssecureapps and
    enable less secure apps . So that you will be able to login from all apps.
    solution 1 for case 3: (This might be helpful) you need to review the activity. but reviewing the activity will not be helpful due to latest security
    standards the link will not be useful. So try the below case.
    solution 2 for case 3: If you have hosted your code somewhere on production server and if you have access to the production server, than take remote
    desktop connection to the production server and try to login once from the browser of the production server. This will add exception for login to google and you will be allowed to login from code.
    But what if you don't have access to the production server. try
    the solution 3
    solution 3 for case 3: You have to enable
    login from other timezone / ip for your google account.
    to do this follow the link https://g.co/allowaccess and
    allow access by clicking the continue button.
    And that's it. Here you go. Now you will be able to login from any of the computer and by any means of app to your google account.
    Regards,
    Nabeel Arif

  • How to configure the smtp server..

    i had an error when running the java mail program..
    this is my program
    import javax.mail.*;
    import javax.mail.internet.*;
    import javax.activation.*;
    import java.io.*;
    import java.util.Properties;
    public class MailClient
    public void sendMail(String mailServer, String from, String to,
    String subject, String messageBody,
    String[] attachments) throws
    MessagingException, AddressException
    // Setup mail server
    Properties props = System.getProperties();
    props.put("mail.smtp.host", mailServer);
    // Get a mail session
    Session session = Session.getDefaultInstance(props, null);
    // Define a new mail message
    Message message = new MimeMessage(session);
    message.setFrom(new InternetAddress(from));
    message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
    message.setSubject(subject);
    // Create a message part to represent the body text
    BodyPart messageBodyPart = new MimeBodyPart();
    messageBodyPart.setText(messageBody);
    //use a MimeMultipart as we need to handle the file attachments
    Multipart multipart = new MimeMultipart();
    //add the message body to the mime message
    multipart.addBodyPart(messageBodyPart);
    // add any file attachments to the message
    // addAtachments(attachments, multipart);
    // Put all message parts in the message
    message.setContent(multipart);
    // Send the message
    Transport.send(message);
    protected void addAtachments(String[] attachments, Multipart multipart)
    throws MessagingException, AddressException
    for(int i = 0; i<= attachments.length -1; i++)
    String filename = attachments;
    MimeBodyPart attachmentBodyPart = new MimeBodyPart();
    //use a JAF FileDataSource as it does MIME type detection
    DataSource source = new FileDataSource(filename);
    attachmentBodyPart.setDataHandler(new DataHandler(source));
    //assume that the filename you want to send is the same as the
    //actual file name - could alter this to remove the file path
    attachmentBodyPart.setFileName(filename);
    //add the attachment
    multipart.addBodyPart(attachmentBodyPart);
    public static void main(String[] args)
    try
    MailClient client = new MailClient();
    String server="smtp.canvasindia.com";
    String from="[email protected]";
    String to = "[email protected]";
    String subject="Test";
    String message="Testing";
    String[] filenames ={"c:/A.java"};
    client.sendMail(server,from,to,subject,message,filenames);
    catch(Exception e)
    e.printStackTrace(System.out);
    the error is .................
    javax.mail.SendFailedException: Invalid Addresses;
    nested exception is:
    com.sun.mail.smtp.SMTPAddressFailedException: 553 Attack detected from p
    ool 59.144.8.116. <http://unblock.secureserver.net/?ip=59.144.8.*>
    at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1196)
    at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:584)
    at javax.mail.Transport.send0(Transport.java:169)
    at javax.mail.Transport.send(Transport.java:98)
    at MailClient.sendMail(MailClient.java:47)
    at MailClient.main(MailClient.java:84)
    Caused by: com.sun.mail.smtp.SMTPAddressFailedException: 553 Attack detected fro
    m pool 59.144.8.116. <http://unblock.secureserver.net/?ip=59.144.8.*>
    at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1047)
    ... 5 more
    how to configure the smtp server in my machine..
    please guide me...

    This uses gmail account, and gmail smtp
    * MailSender.java
    * Created on 14 November 2006, 17:07
    * This class is used to send mails to other users
    package jmailer;
    * @author Abubakar Gurnah
    import javax.mail.*;
    import javax.mail.internet.*;
    import java.util.*;
    public class MailSender{
        private String d_email,d_password;
         * This example is for gmail, you can use any smtp server
         * @param d_email --> your gmail account e.g. [email protected]
         * @param d_password  --> your gmail password
         * @param d_host --> smtp.gmail.com
         * @param d_port --> 465
         * @param m_to --> [email protected]
         * @param m_subject --> Subject of the message
         * @param m_text --> The main message body
        public String send(String d_email,String d_password,String d_host,String d_port,
                String m_from,String m_to,String m_subject,String m_text ) {
            this.d_email=d_email;
            this.d_password=d_password;
            Properties props = new Properties();
            props.put("mail.smtp.user", d_email);
            props.put("mail.smtp.host", d_host);
            props.put("mail.smtp.port", d_port);
            props.put("mail.smtp.starttls.enable","true");
            props.put("mail.smtp.auth", "true");
            //props.put("mail.smtp.debug", "true");
            props.put("mail.smtp.socketFactory.port", d_port);
            props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
            props.put("mail.smtp.socketFactory.fallback", "false");
            SecurityManager security = System.getSecurityManager();
            try {
                Authenticator auth = new SMTPAuthenticator();
                Session session = Session.getInstance(props, auth);
                //session.setDebug(true);
                MimeMessage msg = new MimeMessage(session);
                msg.setText(m_text);
                msg.setSubject(m_subject);
                msg.setFrom(new InternetAddress(m_from));
                msg.addRecipient(Message.RecipientType.TO, new InternetAddress(m_to));
                Transport.send(msg);
                return "Successful";
            } catch (Exception mex) {
                mex.printStackTrace();
            return "Fail";
        //public static void main(String[] args) {
        //    MailSender blah = new MailSender();
        private class SMTPAuthenticator extends javax.mail.Authenticator {
            public PasswordAuthentication getPasswordAuthentication() {
                return new PasswordAuthentication(d_email, d_password);
    }

  • My Server requires authentication

    Hi guys
    We have set up SMTP on Exchange front end and only for 5 managers, the server require auhtenticacion via SMTP. How I can set up this on Iphone?, if I use another POP3 such as Outlook Express i haven´t problems because Outlook express show me in the server "tab" the option "my server requires authentication", can someone help me?
    Thanks in advance
    MV

    It started working later, not sure why. So it is possible. I consider this question answered.

  • Javamail could not connect to SMTP Server

    Hi, I was bored and decided to create a small email application.
    I tryed to connect to my ISP's SMTP Server but I get the following MessagingException
    I don't know but I think my problem lies within my Authenticator class.
    Please tell me if I am correct and how I would fix it.
    create email -      true
    send   email -      false
    javax.mail.MessagingException: Could not connect to SMTP host: smtp.telkomsa.net, port: 25, response: -1
            at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1379)
            at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:412)
            at javax.mail.Service.connect(Service.java:288)
            at javax.mail.Service.connect(Service.java:169)
            at javax.mail.Service.connect(Service.java:118)
            at javax.mail.Transport.send0(Transport.java:188)
            at javax.mail.Transport.send(Transport.java:118)
            at EMAIL.Email.send(Email.java:101)
            at ENTRY.Start.main(Start.java:15)here is part of my code:
        public boolean createEmail(){
            try{
                props.setProperty( "mail.smtp.host", AddressBook.getHost() );
                session = Session.getDefaultInstance( props,(Authenticator)new MyAuthenticator());
                message = new MimeMessage( session );
                message.setText( text );
                message.setSubject( subject );
                if( AddressBook.containsEntry( from ) ){
                    message.setFrom( new InternetAddress( AddressBook.getAddress( from ) ) );
                } else {
                    if( AddressBook.isValidEmailAddress( from ) ){
                        message.setFrom( new InternetAddress( from ) );
                    } else {
                        throw new Exception( "\"From\" address not valid" );
                for( String recipient : to ){
                    message.addRecipient( Message.RecipientType.TO, new InternetAddress( recipient ) );
                for( String recipient : cc ){
                    message.addRecipient( Message.RecipientType.CC, new InternetAddress( recipient ) );
                for( String recipient : bcc ){
                    message.addRecipient( Message.RecipientType.BCC, new InternetAddress( recipient ) );
                return true;
            }catch( Exception ex ){
                ex.printStackTrace();
                return false;
            return true;
        public boolean send(){
            try{
                Transport.send( message );
                return true;
            }catch( Exception e ){
                e.printStackTrace();
                return false;
        }Authenticator class
    import javax.mail.Authenticator;
    public class MyAuthenticator extends Authenticator{
        @Override
        protected PasswordAuthentication getPasswordAuthentication(){
            return new PasswordAuthentication( "[email protected]", "xxxxxxxx" );
    }

    I have muiltiple for gmail, telkom (My ISP) and work.
    When I try it through gmail it worx but my ISP's smtp host still bounces the message:
    Email recieved from [email protected]
    [email protected] to me
    show details 10:31 PM (10 minutes ago) Reply
    Hi. This is the qmail-send program at telkomsa.net.
    I'm afraid I wasn't able to deliver your message to the following addresses.
    This is a permanent error; I've given up. Sorry it didn't work out.
    Your message was bounced by our server.
           If you have any other queries please contact our support:
    TelkomInternet Support Desk Number: 10215
    TelkomInternet Support Desk Mail: [email protected]
    <[email protected]>:
    Warning: undefined mail delivery mode: normal (ignored).
    The users mailfolder is over the allowed quota (size). (#5.2.2)
    --- Below this line is a copy of the message.
    Return-Path: <[email protected]>
    Received: (qmail 18884 invoked from network); 23 Nov 2008 20:31:06 -0000
    Received: from unknown (HELO ironport1.telkomsa.net) ([xxx.xx.xxx.xxx])
             (envelope-sender <[email protected]>)
             by O (qmail-ldap-1.03) with SMTP
             for <[email protected]>; 23 Nov 2008 20:31:06 -0000
    X-IronPort-Anti-Spam-Filtered: true
    X-IronPort-Anti-Spam-Result: ArwAANpLKUlIDszicWdsb2JhbACSSlQ+AQwKCQkPBa47gQKJfAEDAQOCeQ
    Received: from qb-out-0506.google.com ([72.14.204.226])
    by ironport1.telkomsa.net with ESMTP; 23 Nov 2008 22:31:01 +0200
    Received: by qb-out-0506.google.com with SMTP id f29so1924750qba.33
           for <[email protected]>; Sun, 23 Nov 2008 12:30:59 -0800 (PST)
    DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
           d=gmail.com; s=gamma;
           h=domainkey-signature:received:received:cc:message-id:subject
            :mime-version:content-type:content-transfer-encoding:from:date;
           bh=ip5PW6igBRoELerpvPl2DF77VNe5JC4vopdDoV6lpjY=;
           b=TU+Y61W432FfMIYvEmhD2r6eBDdrure+Ax+U4FIi7El3vHt2AES+mb3I2qsvvhyiAy
            CJhqO7FzQakkIkRGIWJOf4ghjrk6e6K1XIBvprPRSABVF/TvqpyFKaVc3tXJ7isW13Nh
            9Ad0Zn6/2dYjM+awXmEnzeDut5l9JB7kOApDw=
    DomainKey-Signature: a=rsa-sha1; c=nofws;
           d=gmail.com; s=gamma;
           h=cc:message-id:subject:mime-version:content-type
            :content-transfer-encoding:from:date;
           b=S8/unLzvAR7/+c1KB3PGimhO4StOsIE0r2S39oEaYLZI8jCP5F/vJg5wc/LfK2gsi3
            KypsThXRKgcjREtjmQPltOdqZhgwf+QJXW/Tg6zFaMRswgJFqig8aeY+uFddCaYTrxoc
            EtYglspCmhfJfUleh7ioCoW2w8G71rcLcN1qA=
    Received: by 10.64.184.18 with SMTP id h18mr2648302qbf.27.1227472259580;
           Sun, 23 Nov 2008 12:30:59 -0800 (PST)
    Return-Path: <[email protected]>
    Received: from 5200am2x64bit ([41.246.118.18])
           by mx.google.com with ESMTPS id p27sm3343039qbp.16.2008.11.23.12.30.57
           (version=SSLv3 cipher=RC4-MD5);
           Sun, 23 Nov 2008 12:30:58 -0800 (PST)
    Cc: [email protected]
    Message-ID: <8694729.0.1227472251250.JavaMail.NEIL@5200am2x64bit>
    Subject: My First Email
    MIME-Version: 1.0
    Content-Type: text/plain; charset=us-ascii
    Content-Transfer-Encoding: 7bit
    From: [email protected]
    Date: Sun, 23 Nov 2008 12:30:58 -0800 (PST)
    - Show quoted text -
    Hello this is a email

  • How can I control SMTP server list in Mail?

    I've seen a lot of discussion about e.g. deleting servers, but it often includes smug replies like "click the delete button" when there is often no such button. I have found a possible 'get around' to this particular problem by changing the server data to something that doesn't exist, save that, then select the server again from the list and hey presto, there is now a Delete button you can use. But again, that is not the full story because if that server is used as the primary server for any other account, you cannot modify the data.
    Not only that, but you CANNOT simply swap servers so that e.g. an account uses one of the other servers as its primary server. Unless I'm missing something major here, it is NOT possible to move servers. You can change the data for the server to be exactly the same as another server, but that just means you now have an identical duplicate. Once a server entry has been created, it is an independent data entity.
    So I seem to have several problems here.
    1. A server cannot be deleted if it's in use as a primary for any account.
    2. Servers cannot be moved, i.e. swapped between 'Primary' and 'Other'
    3. Simply editing the server data does not 'merge' it with any other entry that may have the exact same data.
    4. When creating an account, you cannot pick the outgoing SMTP server from the list of ones already created. Simply entering the same data as one that already exists may use that existing server, but may create a new duplicate. I have seen both of these occur and once there's a duplicate, you cannot get rid of it.
    I want 3 accounts to all use the same 'Primary' server and also have the same 'Other' server. IOW, only 2 actual servers. After the first 2 accounts are created, that's what I have. Somehow they seem to be able to 'share' the same servers. But when I create the third account and enter the same data for its SMTP server as the others use as their primary (i.e. exactly the same process as when creating the second account), for some reason it does NOT use the existing matching server and I now get a third server created. I simply cannot get around this since whatever I do, each of the duplicates is used as a primary and so cannot be deleted. If I could swap them around so that the third account was using another account as its primary, then I could delete the duplicate and all would be well, but as pointed out above, that's not possible.
    I'm hoping that I'm simply wrong about all this and it is actually possible to do what I currently believe it impossible. Can anyone explain how to actually control this server list?

    can't edit SMTP server list in Mail
    i have exactly the same problem using 10.9.4 - did you ever get a reply?

  • How to config Gmail SMTP server for Crystal Report servers

    Hi Experts,
    My customer is using Gmail. They need to send out email from Gmail account via Crystal Reports Server to do some reports bursting.
    I tried many ways to setup in both CrystalReportJobServer and DestinationJobServer, but just got the following error message.
    [AccountsID (8caa73d5-fd2d-469d-8ef2-4d8bd277dc20)]. login error. [[CrystalEnterprise.Smtp] ([1]/[1])]: [SMTP Server does not support authentication. Return code: [SMTP 502 - Command not implemented.].] (FBE60013)
    User name and password are correct. It seems it just cannot get authentication.
    Anyone can help? Thanks in advance.
    Regards,
    Christina

    Hello,
    Sebastian is right. BO doesn't support SSL for email.
    However, there is a workaround by using a program sTunnel which redirects a default connection to a SSL connection.
    Have a look at the note 1611420 which explains on how to do it.
    (https://bosap-support.wdf.sap.corp/sap/support/notes/1611420)
    This will not be supported by BO of course but feel free to test it
    Regards,
    Philippe

  • JavaMail configuration with gmail as SMTP server

    Hello,
    I am trying  to implement component based alerting in our new SAP PO 7.31 landscape. I have configured the steps according to the blog of Michel the necessary steps.
    I am planning to use GMAIL SMTP server and hence trying to configure the parameters for the same. However in the Java Schduler Logs i could see exception TLS excpetion.
    I tried configuring mail.smtp.host as smtp.gmail.com with my gmail credentials. Also i tried giving mail.smtps.host as smtp.gmail.com but no luck.
    Please let me know incase anyone had implemented this scenario. Also please let me know whether it is possible to get the WSDL of the CMBA alert that gets raised.
    Thanks in advance.
    Regards

    Hi Ameet,
    We have it running on your PI systems. Please see the links below. Would suggest downloading Hermes and monitoring the error messages on the JMS queue.
    PI Alerting on AAE/AEX
    Customize E-Mail Body and Subject in Alerts in SAP PI 7.31 – Java Stack Only – Part 1 – ESR
    How to send Alerts using UDF or JAVA Mapping
    Customize Alerts Using Job in PI 7.31/PO
    Regards
    Jannus Botha

  • How to get default SMTP server name

    Hi,
    I want to know the name default SMTP server configured in machine. How i can get this through my java code.
    Help me on this

    You can find STMP server configured in hostname, in ask to dns of domain who is mailserver, you need to find MX records :
    - look a DNS config : NS (name server) , CNAME (Alias) , MX (mailexchange) etc...
    import java.util.ArrayList;
    import java.util.Hashtable;
    import javax.naming.*;
    import javax.naming.directory.*;
    public class MXLookup
         public static void main(String args[]) throws NamingException
              System.out.println(getMX("altern.org") + " mail servers");
         private static ArrayList getMX(String hostName) throws NamingException
              // Perform a DNS lookup for MX records in the domain
              Hashtable env = new Hashtable();
              env.put("java.naming.factory.initial", "com.sun.jndi.dns.DnsContextFactory");
              DirContext ictx = new InitialDirContext(env);
              Attributes attrs = ictx.getAttributes(hostName, new String[] { "MX" });
              Attribute attr = attrs.get("MX");
              // if we don't have an MX record, try the machine itself
              if ((attr == null) || (attr.size() == 0))
                   attrs = ictx.getAttributes(hostName, new String[] { "A" });
                   attr = attrs.get("A");
                   if (attr == null) throw new NamingException("No match for name '" + hostName + "'");
              ArrayList res = new ArrayList();
              NamingEnumeration en = attr.getAll();
              while (en.hasMore())
                   String x = (String) en.next();
                   String f[] = x.split(" ");
                   if (f[1].endsWith(".")) f[1] = f[1].substring(0, (f[1].length() - 1));
                   res.add(f[1]);
              return res;
    }

  • How to find the smtp server on a linux box?

    Hello,
    I am trying to set up Notification Methods in OEM and I need to know the SMTP server and port. Which command can I use on Linux to find this information? Thank you in advance.

    Netstat is not necessarily the right tool for this task.
    Sorry, but "netstat -a | grep 25" will not be useful. For example:
    netstat -a | grep 25
    unix  2      [ ]         DGRAM                    128925
    unix  3      [ ]         STREAM     CONNECTED     11825 Better grep for "smtp". For example:
    netstat -a | grep smtp
    tcp        0      0 vm015.example.com:smtp      *:*                         LISTEN
    lsof is a better tool, but requires "root" or superuser privileges. For instance:
    lsof -i :smtp
    COMMAND   PID USER   FD   TYPE DEVICE SIZE NODE NAME
    sendmail 3098 root    4u  IPv4  13077       TCP vm015.example.com:smtp (LISTEN)Keep in mind however that processing and routing email in is usually a more complex task and involves either to know firewall and mail gateway configurations, or ask your mail administrator. The local mail server may not be permitted to relay email to the company wide smtp gateway depending on routing policies.

  • The SMTP server requires a secure connection or the client was not authenticated. -.

    Hello
    I wrote this code. I searched but could not find a solution for my problem.
    private void button_sendemail_Click(object sender, EventArgs e)
    string temp = "mygmailpassword";
    System.Security.SecureString password = new System.Security.SecureString();
    temp.ToCharArray().ToList().ForEach(p => password.AppendChar(p));
    string mailfrom = "…@gmail.com";
    string mailto = "…@yahoo.com";
    string subject = "Hello";
    string body = "Hello, I'm just writing this to say Hi!";
    using (MailMessage mail = new MailMessage())
    mail.From = new MailAddress(mailfrom);
    mail.To.Add(mailto);
    mail.Subject = subject;
    mail.Body = body;
    mail.IsBodyHtml = true;
    // Can set to false, if you are sending pure text.
    using (SmtpClient smtp = new SmtpClient("smtp.gmail.com", 587))
    smtp.UseDefaultCredentials = false;
    smtp.DeliveryMethod = SmtpDeliveryMethod.Network;
    smtp.Credentials = new NetworkCredential(mailfrom, password);
    smtp.EnableSsl = true;
    smtp.Send(mail);

    Hi ARZARE,
    After some research and i have tested your code, it works fine on my side. But i used Hotmail
    using (SmtpClient smtp = new SmtpClient("smtp.live.com", 587))
    Per my understanding, you're trying to send from an @gmail.com address and they will require authentication, but you don't have credentials specified.  Try sending from @hotmail.com or change smtp.EnableSsl
    = false to see what happens.
    Best regards,
    Kristin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • 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

  • How to solve the SMTP server issue.

    I did the migration from SharePoint 2010 to SharePoint 2013 , the workflow emails are sent perfectly in SharePoint 2010 but when i configure the SharePoint 2013 the following error has occurred. 
    Error : The e-mail message cannot be sent. Make sure the outgoing e-mail settings for the server are configured correctly.
    Please let me know if you aware of this.
    -Thanks,
    Swapnil

    That's pretty much all the settings you need to do on the SharePoint side.  Does the SMTP server that you are pointing to allow incoming emails from your SharePoint server IP Address?  It might only allow relay services to specific IP ranges.
     Or maybe you have a firewall that is blocking it?

Maybe you are looking for

  • How do you create an xsd file for an xml schema in BI Publisher?

    Helllo. I hope this is a really daft question for somebody.. How I create an xsd file to be used as an xml schema to attach to a Data Definition that Ive created? I've obv. got the xml and rtf files ready and attached. I've looked through the relevan

  • My iphone 4 just shut down and wont turn on and i tried everything..

    hi my iphone 4 was working properly last night abd out of no where it kept freezing and turning off and the apple came on and later on it completly turned off and i tried everything to turned it on and nothing, today in the morning i plugged it in to

  • Delete a specific column only not the rows

    Hi below is my select statement select b.* from alco_external_key b inner join alco_user as a on  a.user_id = b.bob_id where b.external_key = '025' and it displays 3 columns (empID,emp_external_id,external_key) is there a way to only delete the value

  • SAP_PA Service - Configuring for IT 0019

    Hi Experts I have done the necessary steps such that using HCM Forms and SAP_PA Service, IT 0019 gets updated when a particular form is submitted but I think i missed some point somewhere as it is not updating IT 0019. Can any1 help me with it? The C

  • Video test works but.....

    I can multivideo chat with the apple test sites, but when I try to get to my daughter she can not see an invite and then I get an unknown failure message. The only thing that has changed was my computer. She has an hp laptop and was able to receive i