Sending an Email using JavaMail from the Net Work of my company not workin

Hi,
If any body would reply to this issue as soon as possible..
I have developed a simple java mail program which sends an email to gmail (smtp.gmail.com) and works fine at home , So when i sent the same
from my office(at company) it did not work and exception was reported saying ...... could not connect to host .smtp.gmail.com... port .. .
I think it's a network problem.
So If any body has a suggestion ?
If so can any body give a simple code for this issue.
Regards,

No, I don't mean the msgshow.java demo program. I mean the [JavaMail FAQ|http://java.sun.com/products/javamail/FAQ.html].
In particular, the section about debugging connection problems and the section
about connecting to Gmail.
Find it yet?

Similar Messages

  • How to send secure email using JavaMail

    Hi, anyone out there know how to send secure email using Java Mail? Greately appreciated.

    For starters, if you have not already done so, read about it in the JavaMail design specifications.
    Search for Message Security in the said document.

  • How to Send Html Email using JavaMail?

    I want to send email message body as html.
    as some news sites send.What will easiest way of doing that?

    oops!!!
    Sorry there is one more thing in it the ByteArrayDataSource class. I am posting the code in the class here. Compile it in a separate class.
    class ByteArrayDataSource implements DataSource
        private byte[] data;     // data
        private String type;     // content-type
        /* Create a DataSource from an input stream */
        public ByteArrayDataSource(InputStream is, String type)
            this.type = type;
            try
                ByteArrayOutputStream os = new ByteArrayOutputStream();
                  int ch;
                  while ((ch = is.read()) != -1)
                // XXX - must be made more efficient by
                 // doing buffered reads, rather than one byte reads
                 os.write(ch);
                  data = os.toByteArray();
            } catch (IOException ioex) { }
        /* Create a DataSource from a byte array */
        public ByteArrayDataSource(byte[] data, String type)
            this.data = data;
              this.type = type;
        /* Create a DataSource from a String */
        public ByteArrayDataSource(String data, String type)
              try
             // Assumption that the string contains only ASCII
             // characters!  Otherwise just pass a charset into this
             // constructor and use it in getBytes()
             this.data = data.getBytes("iso-8859-1");
              catch (UnsupportedEncodingException uex)
              this.type = type;
         * Return an InputStream for the data.
         * Note - a new stream must be returned each time.
        public InputStream getInputStream() throws IOException
              if (data == null)
                  throw new IOException("no data");
              return new ByteArrayInputStream(data);
        public OutputStream getOutputStream() throws IOException
              throw new IOException("cannot do this");
        public String getContentType()
            return type;
        public String getName()
            return "dummy";
    }hope this will help
    best wishes
    khuda hafiz

  • HT201320 when i send an email using my hotmail address through outlook my contacts do not receive the mail. when i send the same mail through my iPad or iPhone no problem my contacts receive the mail. this only problem happens when i send mail with my mac

    I have a hotmail email address. I compose my mail useing MS outlook. when i send the mail to my contacts useing my macbook air,my contacts tell me there have not received the mail.
    when i send the same message with my ipad or iphone no problem my contacts receive the mail.
    what is the problem?

    Blair84 wrote:
    Double check your contacts email, and if its incorrect, go to their contact and change it and save it or you can delete the email you put in, and manually type it in.
    Hope this helps.
    How would that help the original poster?

  • When i am sending an email include attachments from my IPhone its receive by image not attached file

    Dear All,
    Greeting
    i am hope receive any answer to solve my proplem

    Posting this as it took me forever to find the fix.  No one with my carrier, Apple etc. seemed to know of the fix or for that matter even recognize that it was an issue. Hopefully this will help someone else.  This is for Exchange 2010
    Log on to the Exchange server hosting OWA
    start run cmd, right click on the cmd and choose run as adminsitrator
    cd C:\Windows\System32\inetsrv\
    appcmd.exe set config -section:system.webServer/serverRuntime /uploadReadAheadSize:"16000000" /commit:apphost
    appcmd.exe set config "Default Web Site" -section:system.webServer/serverRuntime /uploadReadAheadSize:"16000000" /commit:apphost
    restart IIS
    Note that 1600000 should be the size of the allowed email in bytes.

  • The problem is with the new operating system  and sending photo via email when used in my iPad.   From photo I selected 3 photos to send via email. I choose the upload key and choose to send by email. Typing text on the email is very slow.

    The problem is with the new operating system  and sending photo via email when used in my iPad.
    From photo I selected 3 photos to send via email. I choose the upload key and choose to send by email. Typing text on the email is very slow. This is solved by saving the email as a draft and opening the email again from mail.
    Can you amend he system to allow emails to be sent from photo as previously.

    Have you tried restarting or resetting your iPad?
    Restart: Press On/Off button until the Slide to Power Off slider appears, select Slide to Power Off and, after the iPad shuts down, then press the On/Off button until the Apple logo appears.
    Reset: Press the Home and On/Off buttons at the same time and hold them until the Apple logo appears (about 10 seconds). Ignore the "Slide to power off"

  • What is the effective way to Send an Email using SmtpClient Class?

    Hi Everyone
    What is the effective way to Send an Email using SmtpClient Class.
    Thanks

    Hi Shaheena
    The SmtpClient class is used to send e-mail to an SMTP server for delivery.
    This is sample code for sending an email through SMTP
    void sendEmail(string strFrom
    , string strTo
    , string strSubject
    , string strBody)
    /// Author, Md. Marufuzzaman
    /// Created,
    /// Local dependency, Microsoft .Net framework
    /// Description, Send an email using (SMTP).
    MailMessage objMailMessage = new MailMessage();
    System.Net.NetworkCredential objSMTPUserInfo =
    new System.Net.NetworkCredential();
    SmtpClient objSmtpClient = new SmtpClient();
    try
    objMailMessage.From = new MailAddress(strFrom);
    objMailMessage.To.Add(new MailAddress(strTo));
    objMailMessage.Subject = strSubject;
    objMailMessage.Body = strBody;
    objSmtpClient = new SmtpClient("172.0.0.1"); /// Server IP
    objSMTPUserInfo = new System.Net.NetworkCredential
    ("User name", "Password","Domain");
    objSmtpClient.Credentials = objSMTPUserInfo;
    objSmtpClient.UseDefaultCredentials = false;
    objSmtpClient.DeliveryMethod = SmtpDeliveryMethod.Network;
    objSmtpClient.Send(objMailMessage);
    catch (Exception ex)
    { throw ex; }
    finally
    objMailMessage = null;
    objSMTPUserInfo = null;
    objSmtpClient = null;
    Indul Hassan
    Microsoft Community Contributor
    http://www.indulhassan.com
    You Snooze.. You Lose !!

  • Sending an email using the gmail client on the iPhone

    Hello,
    When I send an email using the gmail client on the iPhone, the message I send then shows up in my 'in box' and not my 'sent' box. Mail app on my computer behaves in the same manner. Is there a fix for this?
    Thanks for your help.

    Hi, its because gmail treats each message as a "conversation" rather than emails sent or recieved. so your sent email will say "from me" all in the same inbox. check this on the web based gmail...

  • When emailing a photo from the updated iPhoto, how do I find the CC and BCC button, and how do I send to a group from my address book?

    when emailing a photo from the updated iPhoto, how do I find the CC and BCC button, and how do I send to a group from my address book?

    The email function from iPhoto is pretty basic. The only Bcc available is to yourself (in iPhoto > Preferences > Advanced), cc: does not appear to be available at all, and it does not appear you can email to a group.
    You can change this by going to iPhoto > Preferences > General and next to where it says Email photos using: select Mail. If you do this you have all the options available in Mail including Cc: and Bcc: and the ability to drag a group from Address Book into the mail addresses.
    Best of luck.

  • Can anyone tell me why I can't update my itunes on my p.c?  I get a message saying: the feature you are trying to use is on a net work resource that is unavailable.   Tried uploading from websit, get msg can't delete old version.

    I need some serious help!
    I have been trying to update my itunes to version 10.7 and my Quicktime to version 7.7.3!
    Having no luck!
    So I tried selecting repair software on all of the Apple applications and they seem to have worked.
    Then I selected look for upgrades on my itunes (Help) main screen
    It said their were two updates -   Itunes  10.7   and  Quicktime 7.7.3
    I selected the option to update and the .exe files were loaded to my  Windows 7 p.c.
    However after part of the Itune update completed a message came up on the screen
    saying   "The feature you are trying to use is on a net work resource that is unavailable.
    O.k.
    I then went to the itunes website and tried again.  This time it checked my system the process seemed to be working and all of a sudden I got a message saying my old itunes programs could not be removed and or deleted.  So I tried to delete my old version myself without success it won't let me.
    I've run out of options and am not completely fustrated.
    I have itunes on my desktop, my iphone4, my ipod and in my car. 
    Anyone have any clue how I can resolve this problem?
    Chris Lane
    <Email Edited by Host>

    However after part of the Itune update completed a message came up on the screen
    saying   "The feature you are trying to use is on a net work resource that is unavailable.
    Which particular .msi file does the message go on to say cannot be found? (Several different .msi files might be mentioned in this context: itunes.msi, bonjour.msi, AppleSoftwareUpdate.msi, etc.)

  • How do I get my photos off 1st generation itouch? I have macbook pro, ipad, iphone. Itouch syncs but does not have option to share in any capacity ie send via email, etc. Also, the computer from which photos were originally taken from has crashed.

    How do I get my photos off 1st generation itouch? I have macbook pro, ipad, iphone. Itouch syncs but does not have option to share in any capacity ie send via email, etc. Also, the computer from which photos were originally taken from has crashed.

    It has always been very basic to always maintain a backup copy of your computer.
    Did you fail to back up your pics?
    The photo sync is one way - comptuer to ipod.
    You can e-mail them to yourself (instructions in the manual), but they will not be of the original quality.

  • TS4083 When I send an email using iCloud Mail, it does not appear in the send box.

    When I send an email using iCloud Mail, it does't appear in the send box. Not in icloud, nor on any other devices. Any idea why not?

    not all mail providers sync the send mail part of the mail box
    you can try to contact yahoo if this is the case with them

  • How do I send a raw (push) notification from the server side using an Azure mobile service?

    Hi there!
    Currently I'm able to send toast notifications to my user from my Azure mobile service using the following line of code in one of my server side scripts:
    push.wns.send(opponent_id, payload, 'wns/toast', {
    success: function(pushResponse) {
    console.log("Sent push:", pushResponse);
    request.respond(statusCodes.OK, {});
    error: function(pushResponse) {
    console.log("Error Sending push:", pushResponse);
    request.respond(500, { error: pushResponse });
    But I would like to send a raw notification to my user now, not a toast notification. I've set up a background tasks which runs as soon as a raw notification arrives(I've tested this through the diagnose option of my mobileservicehub and it works).
    I want to send a raw notification now from the server side and I'm kind off lost on how to do that. I've looked for it but can't seem to find an answer to that question, I might be looking for the wrong stuff though.
    I'm looking for a solution that looks the same as the one for a toast notification(as demonstrated in the code above).
    Your help would be greatly appreciated!
    Thanks in advance!
    Jan

    I found the solution to this it was in fact really really easy, I should have read the documentation more properly since it clearly said that the payload for raw notifications could be literally anything but the client has to take care of it.
    So I figured that out!

  • I am unable to send emails using mail from my btinternet and yahoo accounts similar problem to others with mobile me accounts on lion any suggestions?

    I am unable to send emails using mail from my btinternet and yahoo accounts similar problem to others with mobile me accounts on lion any suggestions?

    Do I need to delete all my email accounts and start again?

  • I can't send out email using my iPhone4. I tried to follow the step provided to solve but still not working. What should I do?

    I can't send out email using my iPhone4. I tried to follow the step provided to solve but still not working. What should I do?

    Contact your mail provider and get the CORRECT settings for the outgoing server to set up on your phone.

Maybe you are looking for