473,769 Members | 1,743 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Mail Problem

rsrinivasan
221 New Member
Hi,

When i run the below program to send mail, I hava an error msg like this. What is the problem?

javax.mail.Send FailedException : Invalid Addresses;
nested exception is:
class com.sun.mail.sm tp.SMTPAddressF ailedException: 550 <mailtovasan@ho tpop.com>: Recipient address rejected: Relaying Denied: Authenticate with POP first or contact support@HotPOP. com

at com.sun.mail.sm tp.SMTPTranspor t.rcptTo(SMTPTr ansport.java:11 41)
at com.sun.mail.sm tp.SMTPTranspor t.sendMessage(S MTPTransport.ja va:536)
at javax.mail.Tran sport.send0(Tra nsport.java:151 )
at javax.mail.Tran sport.send(Tran sport.java:80)
at MailExample.mai n(MailExample.j ava:32)


Expand|Select|Wrap|Line Numbers
  1. import java.util.Properties;
  2. import javax.mail.*;
  3. import javax.mail.internet.*;
  4.  
  5. public class MailExample {
  6.   public static void main(String args[]) throws Exception 
  7.   {
  8.  
  9.     String host = "smtp.hotpop.com";
  10.     String from = "mailtovasan@hotpop.com";
  11.     String to = "mailtovasan@hotpoo.com";
  12.  
  13.     // Get system properties
  14.     Properties props = System.getProperties();
  15.  
  16.     // Setup mail server
  17.     props.put("mail.smtp.host", host);
  18.  
  19.  
  20.     // Get session
  21.     Session session = Session.getDefaultInstance(props, null);
  22.     session.setDebug(true);
  23.  
  24.     // Define message
  25.     MimeMessage message = new MimeMessage(session);
  26.     message.setFrom(new InternetAddress(from));
  27.     message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
  28.     message.setSubject("The Subject");
  29.     message.setText("The Message");
  30.  
  31.     // Send message
  32.     Transport.send(message);
  33.   }
  34. }
Thnaks,
May 28 '07 #1
3 2248
JosAH
11,448 Recognized Expert MVP
Your smtp server requires you to authenticate first before you can send anything.
The Exception message speaks for itself.

kind regards,

Jos
May 28 '07 #2
rsrinivasan
221 New Member
Your smtp server requires you to authenticate first before you can send anything.
The Exception message speaks for itself.

kind regards,

Jos
Hi,

I do not know how to do it. Plz tell me what are the steps to authendicate.

Thanks in advance
Srinivas r.
May 28 '07 #3
JosAH
11,448 Recognized Expert MVP
Hi,

I do not know how to do it. Plz tell me what are the steps to authendicate.

Thanks in advance
Srinivas r.
Read the javax.mail API documentation for the protocolConnect () method
but first check whether or not I was right by checking your email account(s).
Does it require you to logon/authenticate for outgoing mail?

kind regards,

Jos
May 28 '07 #4

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

Similar topics

5
3107
by: Bruce W...1 | last post by:
In my effort to learn PHP I'm playing with some simple email scripts. They worked a few days ago but they stopped working. The only thing I've done to this Windows 2000 PC in this time was a Windows Update which I do regularly. The only part of this update that might be related was an IE 6 update. So I uninstalled and reinstaled PHP 4.3.3. The mail server setting is correct in the php.ini file. But email is still not being sent. ...
6
11187
by: DigitalRick | last post by:
I have been running CDONTS in my ASPpages to send emails to me sent from my guestbook. It had been working fine untill I upgraded to Server 2003 (I am also running Exchange 2003) all locally. I will include the code I originally used. I understand I should switch from CDONTS to CDO mail but after several sttempts I am finding a very hard time getting the new CDO mail to work properly. Any assistance with this would be greatly...
4
8674
by: Trond A. S. Andersen | last post by:
Hi, all! I'm trying to use the System.Web.Mail. "package" combinded with System.Web.Mail.SmtpMail in order to send MS Excel spreadsheets attached to mail messages. However, sending one single spreadsheet attachment per message, seems to be causing som kind of corruption of the attachment, while several spreadsheets per works just fine. Consider the following three snippets of C# code:
3
3273
by: Phil Mc | last post by:
Hi has anyone come accross the problem.... with referance to System.Web.Mail.MailMessage and System.Web.Mail.SmtpMail THIS WORKS FINE mail=new MailMessage(); mail.From = "W-MyPcName.mycompany.com"; mail.To=strTo; mail.Cc=strCC; mail.Bcc=strBCC;
17
3785
by: LACH | last post by:
When I sent e-mail from within my asp.net application to Hotmail adresses. The e-mail always end up in Junk e-mail. I sent the e-mail as plain/text. Does anyone know how to solve this?
34
18270
by: antonyliu2002 | last post by:
I've set up the virtual smtp server on my IIS 5.1 like so: 1. Assign IP address to "All Unassigned", and listen to port 25. 2. Access Connection granted to "127.0.0.1". 3. Relay only allow "127.0.0.1". 4. Authentication: "Anonymous access" only. 5. Outbound connection listen to TCP 25. Besides,
4
6131
by: k.visube | last post by:
In my ASP application,i need to send a formatted text mail (i.e with newline characters). here in my application i used a function in javascript which construts the mail body sample snippet strbody=strbody +"dear customer,\n"; strbody=strbody +"we are glad to see ur response\n"; strbody=strbody +"we will make the needful thing as early as possible\n";
9
2902
by: shror | last post by:
hi every body, i have a problem which is when i was checking my mail() form it work fine but the problem is that the form configuration is not set correctly, in details: the from var is not working and the from is set to be my host provider email is the sender, so they told me to configure the php.ini file and i dont know what is this file and how to configure it. thanks in advance
2
2808
by: joseph2000 | last post by:
Hi, I have problem with e-mails which are being send via System.Web.Mail.SmtpMail class but before describing the problem itself first I'd like to show shortly what I'm doing on the server. The following code is being executed on the server to send e-mails to clients (.NET Framework 1.1): .... EmailsInQueCollection eqc = GetUnsentEmails();
9
3469
by: JoeP | last post by:
Hi All, How can I find the reason for such an error: Failure sending mail. Some Code... oMailMessage.IsBodyHtml = False oMailMessage.Body = cEmailBody Dim oSMTP As New SmtpClient oSMTP.Send(oMailMessage) (in this line I am getting the above err)
0
9589
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10212
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9863
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8872
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5304
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3962
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3563
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.