I am trying to make automatic message which will be sent on email but, when i start my program i get :  com.sun.mail.util.MailConnectException: Couldn't connect to host, port: localhost, 25; timeout -1;   I want it to be sent from localhost not exact email with password and username. code:  import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.*;  import javax.mail.*;  import javax.mail.internet.*;  import javax.activation.*;  import javax.mail.Session;  import javax.mail.Transport;    public class Email   {     public static void main(String[] args) throws IOException {         String recipient = "test@gmail.com";        String sender = "sender@gmail.com";        String host = "localhost";         Properties properties = System.getProperties();        properties.setProperty("mail.smtp.host", host);         Session session = Session.getDefaultInstance(properties);         try {            MimeMessage message = new MimeMessage(session);            message.setFrom(new InternetAddress(sender));            message.addRecipient(Message.RecipientType.TO, new InternetAddress(recipient));            message.setSubject("Test sub");             message.setText("Test MSG");             Transport.send(message);            System.out.println("Sent.");          } catch (AddressException e) {            e.printStackTrace();        } catch (MessagingException e) {            e.printStackTrace();        }     }     }   To run this class i am using javax.mail.jar. Does somebody know where the problem is ?
Is it possible to send an email from my Java application using a GMail account?  I have configured my company mail server with Java app to send email, but that's not going to cut it when I distribute the application. Answers with any of using Hotmail, Yahoo or GMail are acceptable.
How do you clone an Array of Objects in Javascript? Unresponsive KeyListener for JFrame Expressing $1.24\overline{123}=1.24\;123\;123\;123\;\ldots$ as the ratio of two integers Run as a different user on a shortcut How do I run as a different user on a shortcut in Windows 7?   On Windows XP, I had the ability to mark a shortcut as being run by a different user, so that every time I ran it it would prompt me for a username/password. This let me have two shortcuts for things like , one for my normal account and one for my domain administrator account which has access to production servers.  I can get to the 'Run as different user' option with Shift + right-click, but I can't see an option anywhere that would let me mark the shortcut as doing this every time. A gerund or use a regular noun? Which of these is correct or more natural?        One of my greatest strengths is critically analyzing.      One of my greatest strengths is critical analyzing.     One of my greatest strengths is critical analysis. What do viruses do? There are those big green spiked things that my friends call viruses. I don't know what they do and I want to know. Do the viruses do something to the device you are playing on? Are they good or bad? What is another word for 'all round' capabilities? I am looking for a positive, passionate word to describe the all-round capabilities of a person.   Are there any words better than 'all-rounder'? UK Standard Visitor visa application to sit for PLAB 1 without savings or job I am a medical doctor in Pakistan. I have been on a career break to allow myself to study full time for the IELTS exam (from which I recently got the required band score) and PLAB 1. I have now registered and paid for the PLAB 1 exam in UK for June 2016, as the next sitting in Pakistan is in November 2016 and I feel like I am ready to do the exam sooner.  Due to having no current employment, my savings are limited (around 25,000 Pakistani Rupees) but I live with my parents and do not have any financial commitments at home.  My savings have depleted in the past ten months whilst I have taken a career break and the money has been used for my own personal expenses. My trip to the UK is being funded by my grandfather who is a British citizen. He is a retired doctor with a good NHS pension. He has provided me with:   6 months bank statements which clearly show his pension deposits   Letter from NHS Pensions stating his pension   Sponsorship letter stating that he will pay for my PLAB exam fee, travel, accommodation and subsistinence costs whilst in the UK   Copy of British passport  Document confirming that he owns the house he lives in mortgage-free Confirmation email from GMC stating he has paid the PLAB exam fee.   Without large personal savings and no current job (but I have job offers now) would my application be rejected or is the strong sponsorship going to be good enough?  Are there any other documents I should consider submitting that may help me get a visa? I'm trying to get the subcaptions and captions in sanserif font and Uppercased. According the manual of the caption package this should be possible in the following way.However, this doesnt seem to work. Am I defining something in the wrong way here?  \documentclass{article} \usepackage{floatrow} \usepackage[demo]{graphicx} \usepackage{subfig} \usepackage{caption} \floatsetup[figure]{subcapbesideposition = top}  \captionsetup{labelfont={sf,up}, labelsep=period, format = plain, singlelinecheck = false, textfont=rm, skip = 2pt} \captionsetup[subfloat]{labelfont = {up,sf},format = plain,textfont = rm,labelformat = simple, labelsep = period}  \begin{document}   \begin{figure}[h!]   \ffigbox[\textwidth]     {\begin{subfloatrow}         \sidesubfloat[]{\includegraphics[width = 0.4\textwidth]{A.pdf}}%         \sidesubfloat[]{\includegraphics[width = 0.4\textwidth]{B.pdf}}%       \end{subfloatrow}       \begin{subfloatrow}         \sidesubfloat[]{\includegraphics[width = 0.4\textwidth]{C.pdf}}%         \sidesubfloat[]{\includegraphics[width = 0.4\textwidth]{D.pdf}}%       \end{subfloatrow}}     {\caption{this is a caption}} \end{figure}  \end{document} I want to argue that argue that $\pi(\alpha)=\alpha^3+3\alpha+3$ is an irreducible polynomial over the finite field with 5 elements $\mathbb{F}_5$. My approach was just to check that $\pi$ has no roots in $\mathbb{F}_5$. Is this right? Why is Newton's first law necessary? Newton's second law says $F=ma$. Now if we put $F=0$ we get $a=0$ which is Newton's first law. So why do we need Newton's first law ?   Before asking I did some searching and I got this: Newtons first law is necessary to define inertial reference frame on which the second law can be applied.  But why can't we just use Newton's second law to define an inertial frame? So if $F=0$ but $a$ is not equal to 0 (or vice versa), the frame is non-inertial.  One can say (can one?) we cannot apply the second law to define a reference frame because it is only applicable to inertial frames. Thus unless we know in advance that a frame is inertial, we can't apply the second law.  But then why this is not the problem for the first law?  We don't need to know it in advance about the frame of reference to apply the first law. Because we take the first law as definition of an inertial reference frame.  Similarly if we take the second law as the definition of an inertial frame, it should not be necessary to know whether the frame is inertial or not to apply the second law (to check that the frame is inertial). Can I install Android on my non-Android device? Using a diode to ensure current flows in only one direction, without causing a voltage drop To power my microcontroller (ATmega8), I am using a ~5.4V voltage source. I want to ensure that I don't accidentally connect the voltage source in reverse, and figured a diode would be a nice way to accomplish this as from what I have learned so far, a diode allows current to flow in one direction, and blocks it in the other.  But what I also learned is that diodes create drops in voltage. I have a few of the typical diodes (1N4001, 1N4148, etc.), and would like to use them to achieve the aforementioned result without dropping the voltage as it would be too low to power the IC.  My question is, is there any way to do this with a diode? Or do I need some other component (if so, what would you recommend)? Are omniscience and omnipotence mutually inconsistent? I see this in The God Delusion by Richard Dawkins:       If God is omniscient, he must already know how he is going to intervene to change the course of history using his omnipotence. But   that means he can't change his mind about his intervention, which   means he is not omnipotent.   Is this argument sound? I am running Ubuntu GNOME 15.10 with GNOME 3.18, and I would like to know if I can do any of the following and if so how:   Make it so that a folder is not indexed but leave its contents indexable (so that if I search for that folder's name in my system nothing will come up, but if I search for its contents, that will come up) Make it so that a folder is not indexable and nor is any of its contents (and if it contains sub-folders within it then it should recursively not allow any contents in them to be indexed nor the contents of any sub-sub-folders in the sub-folders etc, nor any of those sub-folders themselves) Make it so that individual files in a folder are not indexable, though not having any impact on other contents nor the parent-folder   So, are any of these variants possible? I believe the indexing program is called Tracker which indexes files and folders and their contents and allows for one to search for them on the system. Cycle option when drawing between nodes in TikZ Cycle lets you close curves when drawing, and  \coordinate (a) at (0,0); \coordinate (b) at (1,0); \coordinate (c) at (0.5, -1); \draw (a) -- (b) -- (c) -- cycle;   works fine. Shouldn't also  \node (a) at (0,0) {}; \node (b) at (1,0) {}; \node (c) at (0.5, -1) {}; \draw (a) -- (b) -- (c) -- cycle;   give the same result?  The former gives a triangle, while the second doesn't close up. Is this a bug or am I missing something regarding the cycle option?  (Of course, as a workaround I could use the coordinates to draw the cycled path, and then draw the nodes at the same coordinates, but still...) How to make skill use on investigations "important" but failure not derail the plot? Well guys, following previous recommendations here I was able to build a Horror Themed Savage Worlds campaign that has made my players excited. However they're still getting used to the style, as well as I am. In order for them to hurt the major evils of the adventures they have to find their Form (physical appearance, name), Truth (How the creature came to be) and Reason (What the creature wants to), so they have to do research, kill lesser creatures, and run away from the big baddie of the adventure as they seek what it is.  Well, this is my problem:  How can I make them use skills significantly?  I'm used to railroading my players, even with mysteries, and I don't know how to put their skills for significant use. An example is, they usually require Streetwise or Investigation to gather clues and such, however, I wonder what to do if they fail the roll... If they fail they're not supposed to find anything, so chances they never finish the adventure are well, high, that and I have no idea how to give them additional, interesting ways for them to find the truth. So do I give it no matter what they rolled? How do I make use of their skills important and not just busy-work without having a failure on a roll completely stop their progress in the investigation? Where can I get an Ubuntu Installation CD/DVD/USB? I need to upgrade my existing Ubuntu system, and I also want to install Ubuntu on a new laptop.  I would like to have an installation CD or DVD to do both of these.  Where exactly I can order or request an Ubuntu installation CD/DVD/USB? Postfix SMTP banner show multiple hostnames Managing CPU intensive threads on iOS