473,407 Members | 2,320 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Java Mailing problem

ashsa
45
Hi all,

I was jus working around with the JavaMail API and was stuck at the end with an error from the smtp server saying that

Your email message was unable to be sent because your mail server rejected the message:
550 Invalid recipient : b@b.com

Googled for almost the entire day for a solution but in no avail.


The code i use is in a jsp page and is as follows:

<%@page import="java.util.Properties"%>
<%@page import="javax.mail.*"%>
<%@page import="javax.mail.internet.*"%>
<%
String smtpHost ="localhost";
String from ="a@a.com";
String to ="b@b.com"; // ---- These "from" and "to" are absolutely valid email ids i used !!

Properties props = new Properties();
props.put("mail.smtp.host", smtpHost);
MimeMessage message = new MimeMessage(Session.getDefaultInstance(props, null));
message.setFrom(new InternetAddress(from));
message.addRecipient(Message.RecipientType.TO,new InternetAddress(to));
message.setSubject("Test Mail");
message.setText("Welcome to the JDC");
Transport.send(message);
%>

The reason i used "localhost" for smtp host is that i am running a free smtp server i downloaded and i ve checked with the smtp conversations with the application and it works fine.

Any Help ??

Many Thanks in advance..
Apr 4 '07 #1
0 1087

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Steven M. Scotten | last post by:
Hi-- I seem to have the PHP Java Bridge (2.0.5 built from tarball) working with PHP 5.0.3 (also built from tarball) on my Fedora Core 1 server with Apache 2.0.50 and I'm pretty excited about it...
7
by: Spammay Blockay | last post by:
Does anybody know of a solid Java-based email list management product? - Tim --
2
by: Fred | last post by:
Hi, I'm thinking about using a USB attached device for some data collection. I can use other languages to "talk" with it, but I'd prefer a Java solution. Does anybody have any experience with USB...
18
by: kk | last post by:
I read this mailing list fairly often, and I am always amazed at what I learn (even not related to Python). I am relatively new to Python. I make my living developing mostly in Java. Python was a...
114
by: Maurice LING | last post by:
This may be a dumb thing to ask, but besides the penalty for dynamic typing, is there any other real reasons that Python is slower than Java? maurice
5
by: Robert Oschler | last post by:
Preamble: - I know this is the Python forum - I know about (and have used) Jython I already posted this question in comp.lang.java. But after a week I have still not received a single reply....
0
by: Brian van den Broek | last post by:
Hi all, There have been a few posts over the last month or so expressing a bit of exasperation with the "rising tide of newbie's". (Or, more accurately, the rising tide of questions from...
1
by: Andrew Neiderer | last post by:
I have some Scaleable Vector Graphics (SVG) in which I need to add some Java code (I guess via a <script>), which uses the DOM to update attributes. I am thinking a XMLHttpRequest will get me the...
3
by: Grim Reaper | last post by:
I print mailing labels out of Access 2000 databases about 3 to 4 times a week. I have been having problems with one thing since I have been printing mailing labels. I print mailing labels by...
318
by: King Raz | last post by:
The shootout site has benchmarks comparing different languages. It includes C# Mono vs Java but not C# .NET vs Java. So I went through all the benchmark on the site ... ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.