reset password
Author Message
raylongma1018
Posts: 81
Posted 18:59 Aug 22, 2015 |

Hi Dr.Sun or Harsh:

After I finished watching the video, I try to test the code for email part. I first download email code from repository then I input the same input (from, to , subject, and content) as from video, but after I click send It gives me an error

here is the error message:

javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 25;

I wonder if this has anything to do with my tomcat server setting. so for the user I send it to for example cysun@localhost.localdomain. how do I set up the local user on my tomcat. Also I never use the microsoft overlook before. Will the email automatcially send it to outlook or should I configure the microsoft outlook in order to recieve the localhost email. 

Please help

hgadhia
Posts: 52
Posted 19:20 Aug 22, 2015 |

I am not sure, I haven't tried sending email from localhost to outlook account, but I guess, in order to receive emails in outlook, you require to configure outlook account for that user(cysun@localhost.localdomain).

However, You can refer this, for sending emails to an external accounts like gmail or yahoo.

raylongma1018
Posts: 81
Posted 19:43 Aug 22, 2015 |

is the properties.put("mail.smtp.host",xxx) the domain name of the sender's email or receiver email?

what is the port 25 mean? is it for sender or receiver?

is the username password from our tomcat server? if so how do we set it?

 

cysun
Posts: 2935
Posted 06:05 Aug 23, 2015 |

Email is sent through an SMTP server, not Tomcat. To run the code you need to install a local email server like hMailServer (see lecture notes) or change the code to use an existing email server.

raylongma1018
Posts: 81
Posted 11:08 Aug 23, 2015 |

thanks for the reply

My problem is my operating system is windows 8.1 which means I don't have the outlook express to test my code but I found link that uses different technology called mozilla thunderbird that can also use to test the code 

here is link:

http://duyhung.1055016.n5.nabble.com/How-to-Setup-localhost-email-server-using-hMailServer-and-Thunderbird-td5704501.html