Sending Failure

When I try to send email, I got the following exception,
javax.mail.SendFailedException: Sending failed;
nested exception is:
class javax.mail.SendFailedException: Invalid Addresses;
nested exception is:
class javax.mail.SendFailedException: 550 <[email protected]>... Relaying denied
here is the code for my program,
public void sendMsg(String to[]){
try {
Properties props = System.getProperties();
props.put("mail.smtp.host", mailhost);
// Get a Session object
Session session = Session.getDefaultInstance(props, null);
// construct the message
Message msg = new MimeMessage(session);
if (from != null)
     msg.setFrom(new InternetAddress(from));
else
     msg.setFrom();
Address toAddress = new InternetAddress("[email protected]");
//msg.setRecipients(Message.RecipientType.TO, InternetAddress.parse(to1, false));
msg.addRecipient(Message.RecipientType.TO, toAddress);
InternetAddress[] addressTo = new InternetAddress[to.length];
for (int i = 0; i < to.length; i++)
addressTo[i] = new InternetAddress(to);
msg.setRecipients(Message.RecipientType.TO, addressTo);
if (cc != null)
     msg.setRecipients(Message.RecipientType.CC, InternetAddress.parse(cc, false));
if (bcc != null)
     msg.setRecipients(Message.RecipientType.BCC,     InternetAddress.parse(bcc, false));
msg.setSubject(subject);
msg.setContent(content, "text/plain");
msg.setHeader("X-Mailer", mailer);
msg.setSentDate(new Date());
// send the message
Transport transport = session.getTransport("smtp");
//transport.connect(mailhost, "", "");
transport.send(msg);
//transport.sendMessage(msg, msg.getAllRecipients());
transport.close();
System.out.println("Mail was sent successfully.");
catch (Exception e) {
     e.printStackTrace();
Can anyone tell me is it due to the invalid address or it cannot relay?
thanks

Hi,
relaying deny does occur while MTA(mail server) send your email
to the target site. some mail server would check some condition
to decide if it has to deal with your request. For exmaple,
your ip is not in its service list, spamming email, or some
thing else. The case may vary and depends on the configuration
of the mail server.
good luck,
Alfred Wu

Similar Messages

  • My 3GS is responding MESSAGE SEND FAILURE when I attach n send photos. Why? And how do I fix it?

    Just started getting a MESSAGE SEND FAILURE response when I attach n send a photo with my texts. Why? How do I fix it?

    Did you try what was suggested on that page i.e. disconnecting the iPad from your computer and turning the iPad off (press and hold the sleep/wake button until the red 'slide to power off' appears on screen and slide that) and then back on ?
    And if the backup doesn't work after that then try a soft-reset instead of the off and on : press and hold both the sleep and home buttons for about 10 to 15 seconds (ignore the red slider), after which the Apple logo should appear - you won't lose any content, it's the iPad equivalent of a reboot.

  • In the past month or so my iPhone 5 battery is dying in hours, whereas it used to last all day at least.  Also, I am getting constant "message send failures" when texting and frequent dropped phone calls.

    Just recently my Iphone 5 battery is dying in a just a few hours, it used to last all day or more.  I'm not doing anything different with it, although I have started shutting down apps etc. to conserve battery.  I get constant "message send failures and frequently dropped phone calls. 

    My best bet would be to restore the phone. Back it up to itunes, and then reset it Factory settings. This way, any corrupt software will be removed, and you can start fresh. Make sure you back it up first. By the sounds of it, you are using the phone for business and probably need the data from it. Hope this helps!

  • Intermittent send failures in Outlook 2011 for MAC

    Ever since Verizon changed its POP server settings, I am getting intermittent send failures from MS Outlook for MAC 2011 even though I made the correct port changes and SSL options in Outlook 2011.  Everywhere I look for assistance, including Microsoft, Apple and Verizon, no one has found anything wrong other than Microsoft suspects that Verizon's server doesn't like too many logins and passwords in a set period of time.  Apparently, every email that is sent, sends a User Name and Password to Verizon's server.  MS suspects that the server doesn't like that and rejects messages within a certain time period.  Furthermore, I cannot find any Verizon support for Outlook 2011 for the MAC!  Once again this is "intermittent" such as 4 messages will go and then the 5th will not.  If I leave it in the outbox, it will eventually send.  I'm not sure that MS's theory is fully correct because sometimes I get the send failures on the first message sent.  The error message says, "Outlook cannot find the server etc."  "Error Code: 3170".  All incoming messages come into Outlook 2011 correctly.  Does Verizon support Outlook 2011 for the MAC?
    Solved!
    Go to Solution.

    Re: Consistent alerts error 3170...and my settings are correct! HELP!
    Options
    ‎12-19-2013 09:47 AM
    I had the same issue.  After talking to a Verizon FIOS technician from thier techinical support center, he said that no changes are needed for Outlook for Mac.  That means the settings should be:
    Incoming server: incoming.verizon.net
    Incoming port: 110
    Use SSL to connect: UNCHECKED
    Outgoing server: outgoing.verizon.net
    Outgoing port: 25
    Use SSL to connect: UNCHECKED
    Hope that helps others not waste an hour searching Verizon's website and trying to navigate their massive phone tree to actually speak to a technician.

  • Message Send Failure - Only in one location

    When sending MMS to ANYONE in my home town, It never goes through and results in a "Message Send Failure". Every once in a while it MIGHT work. I have full bars.. in fact, I can see the tower from my back yard with a clear line of sight. it's right next to my house. But it's only in this location. If i drive 10 mins down the road into the next town, where they have 3G... the picture goes through no problem. I can be in that other town, turn off 3G and just be on Edge.. and still.. the message and picture go right through.
    Is this possibly a problem with the tower in my back yard? All my calls are crystal clear... just data seems to stink. I can surf the web rather slowly.. but all my text messages that have Multimedia attached never work. And this is with every OS version since the 3gs was released.

    any help here, friends?

  • "Sending Failure". Can't send, forward or reply to email with attachments or pictures

    I have a Galaxy S5. When I try to send, forward or reply to an email with an attachment or picture it gets stuck in my outbox with a final message on my notification page of "sending failure". I have removed and re added my email accounts as well as cleared the cache without any luck.  Any suggestions?
    Thanks in advance!

        kpgrl,
    Let's get your emails back in business! Have you tried installing a third party app to use for your email? Have you removed the email and readded it? Please share details.
    KarenC_VZW
    Follow us on Twitter @VZWSupport

  • IMessage message send failure

    Whenever I try to send a message on Imessege the blue bar stops at about 90% and then says message send failure. I have an iPod touch 3rd gen iOS 5 so I don't use 3G. HELP ME!!!!!!!!  Any ideas!!!!!!!!??

    Btw it's the built in iMessege app you get when you update to ios 5 not the other one where you have to download from the app store

  • Everytime i try and send a message to my boyfriend through imessage on my ipad, it says "Message send failure" but all of the messages are coming in through my email, i hate texting my boyfriend through my email. So can someone help me, please.

    Everytime i try and send a message to my boyfriend through imessage on my ipad, it says "Message send failure" but all of the messages are coming in through my email, i hate texting my boyfriend through my email. So can someone help me, please.

    "iMessage allows users to send texts, photos, videos, contact information, and group messages over Wi-Fi or 3G to other iOS 5 users, thus providing an alternative to standard SMS messaging for all users with devices running iOS 5."
    This is what it is and what it does. You both have to have iOS 5 installed on your supported device. If that's not what your setup is, then that's your answer.

  • Why do i keep getting "Message Send Failure" every time I send pictures on iMessage? All are sent to other iPhone/iPad users.

    For a few months now, I've been getting "Message Send Failure" every time I send pictures to other Apple devices (iPhones, iPads, Macs), despite the recipient receiving them. So, even though the pictures are going through, the "Message Send Failure" notice keeps showing up. I checked with other people who have Apple devices and they also encountered the same issue whenever they send pictures (usually send an email to make sure it was received).  I thought when iOS 7.1.1 came out that it would fix this issue. Has anyone else encountered the same issue? Thanks!

    I started getting the error on my iPhone 5 (iOS 7.1.x) several weeks ago - if not a month ago. Today I finally decided to run through a wholesale sign-out/sign-in process on all my devices (iMac, MacBook, iPad 1, iPad 3 and iPhone5) and it worked!
    I signed out of iMessage/Messages on all devices. I also deleted my iCloud accounts on all my devices (make sure you tell the software to keep local copies when you are prompted - relax, it all stays in the cloud, too) Then I signed back in to iMessage/Messages and then re-added iCloud accounts all around. I just sent a message with a photo attachment and did not get the "Not Delivered" message - yay!
    (FYI - even though I received the error every time I sent a message with an image attachment, the message still went through - very, very happy, though to finally get rid of the message...)

  • TS2755 Receiving "Message Send Failure" notification, but messages are going through?

    For the past few days, I have been receiving a "Message Send Failure" after every iMessage that I send. The messages are going through, but I still receive the notification every time. I have restarted my phone, signed out of and back into iMessage, and reset my network settings. Nothing seems to be working. Anyone have a solution? I'm having the same problem on my iPad, which leads me to believe it's a problem with iMessage at large as opposed to a device problem. Thanks!

    If you have others that are receiving your imessaging  but not the group you are attempting to send to then do this:
    Click on your text messaging area using imessaging enabled and then type a message to yourself. Do this test to verify that your imessaging apple server is working properly. IF you get the messsage back to you in BLUE this indicates to you that both the outgoing and incoming text messaging is working as imessaging. With this piece of information verified that will indicate there are connectivity issues with individuals or all that are a part of the group you are attempting to contact. Please do not conclude that at a point in time this communication worked via imessaging that there may be some in the group that are now having conectiviity issues of their own.
    Good luck, Friend.

  • MMS Message Send Failure

    Well the topic pretty much explains the problem. Whenever I try to send a MMS Message, whether it be an existing photo or one just taken by the camera, the message will look like it's about to send, but right when it's on its way the error icon will pop up and I'll get a "Message Send Failure".

    Could this have anything to do with the fact that I've been using the 1st Gen since it came out and AT&T might not have activated my MMS features?

  • "Message Send Failure" keeps popping up over and over again

    I read in Lifehacker that you can send a text to an email address just by putting the email address into the number field. So I thought I'd test it out.
    I started to type the email address and it appeared in the selections above. So I tapped the email I wanted and it said it was being sent as an MMS. Okay, no problem there. So I sent "Test". But it didn't go through. Okay, nevermind.
    Except now a "Message Send Failure" pop up appears every few minutes. No matter what I do I can't get it to stop. I turned off MMS messaging. I rebooted the phone. I'm at a loss and about to throw it out a window!
    Any thoughts?

    it should work. it will show up in your email as your phone number with no dashes @mms.att.net
    Just did it a few minutes ago to show how you can send your Text messages to an email to print out. Not the greatest way to do it but it works.
    As for the message send failure. Try deleting it like the other person said. Check you email app to make sure it isn't sitting in your outbox trying to go out. That is the only other thing I can think of.

  • Message send failure only some contacts

    iPhone 5 two of my contacts cannot receive text messages from my phone! Message send failure. All others are fine cant work out why, updated phone, reset phone also and nothing!!!! Tried with wifi off and on looked at all settings can't see anything amiss! Any ideas???

    any help here, friends?

  • Sending Failure. I can't send, reply or forward an email with attachment or picture.

    I have a Galaxy S5. When I try to send, forward or reply to an email with an attachment or picture it gets stuck in my outbox with a final message on my notification page of "sending failure".  I can receive any email with pics or attachments. I have removed and re added my email accounts as well as cleared the cache without any luck.  Any suggestions?
    Thanks in advance!

    Try doing this, uninstall your email app then power down & remove battery and SIM card. Next re-power phone and do a regular reset of the phone (not a restart)  with SIM installed. This will be listed under settings, backup and restore then tap Reset settings. now reinstall email app and setup your account. This in a normal working phone will clear most email problems along with correct account settings.

  • Message send failure when sending text message to none iPhones. Worked fine at apple store now not working for me again ( whether on wifi or cellular) what is wrong?

    Why am I getting message send failure from my iPad to a non-iPhone

    When I was in the Apple store on Friday with my iPad I asked the text the same question. we turned on my iPad and it allowed me to text text message anybody I wanted regardless of what the device. When I left apple store while I'm in the parking lot and I checked it again before I left the area and it still allowed me to text message anybody. Now it is not. And also I cannot email anybody from my iPad today to a non iPhone and that's wrong because until today I have been doing that for weeks. Hmmmm now what

  • Hi there. I'm an iphone 4s user and i am unable to send text messages. Any time i try, I get the message "message send failure" can anybody help?

    Hi there. I'm an iphone 4s user and i am unable to send text messages. Any time i try, I get the message "message send failure" can anybody help?

    try contacting your carrier and see if they can resolve the issue.

Maybe you are looking for

  • Touchscreen monitors for Windows 8 ?

    I have a hp desktop and monitor and was wondering if HP will be releasing a touchscreen monitor for windows 8. They did a TS monitor afew years ago but discontinued it. If windows 8 if designed more for this hands-on approach, i would think all manuf

  • Error getting schema root with OLAP API

    I am getting the following error: java.sql.SQLException: Io exception: Connection reset by peer: JVM_recv in socket input stream read      void oracle.jdbc.dbaccess.DBError.throwSqlException(java.lang.String, java.lang.String, int)      void oracle.j

  • Update From 10.4 Tiger to 10.5 Leopard?

    Hi,  I use a Power Mac G4 (QuickSilver 2002) Dual, OS X 10.4.11 Tiger. Is it possible to update to OS 10.5 Leopard?  If so, how so. Angel

  • After the most recent update, the screen went white on my touch. Any one else have this prob?

    After recent update of my 4th gen iPod touch, the screen went white. I can still see the background a little but, there is a screen "burn in" as well. I restored it but it did nothing to fix it. AHHHH!

  • Disk Utilities - Erase Disk

    Hi, I recently bought a Transcend's USB ThumbDrive with 16GB. I need to format it for Mac format, But unable to do it and error messege shown as below:~ + Disk Erase Failed with error: input/output error + when i click OK, then, it'll prompt a warnin