Using SMTP should I get an Exception for wrong recipitients?

Hi,
I'm testing JavaMail 1.3.2.
Once I give a fake recipitients, in the TO address, my email is posted correctly.
I have tried with severals SMTP server and I get any error.
I don't remember, if I should get an exception like SendFailedException.
I attach the code, I use for this test.
import java.util.Date;
import java.util.Properties;
import javax.mail.Message;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.event.TransportEvent;
import javax.mail.event.TransportListener;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
import java.util.Date;
import java.util.Properties;
import javax.mail.Message;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.event.TransportEvent;
import javax.mail.event.TransportListener;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
public class MailExample implements TransportListener {
     public MailExample() {
          super();
     public void test() throws Exception {
          // Get system properties
          Properties props = System.getProperties();
          // Setup mail server
          props.put("mail.smtp.host", <SMTP_SERVER>);
          // Get session
          Session session = Session.getInstance(props, null);
          session.setDebug(true);
          // Define message
          MimeMessage message = new MimeMessage(session);
          message.setFrom(new InternetAddress(<SENDER_ADDRESS>));
          message.setRecipients(Message.RecipientType.TO, InternetAddress.parse(
                    ""+new Date().getTime()+"@thisisnotarealaddressihope.com", false));
          message.setRecipients(Message.RecipientType.BCC, InternetAddress.parse(
                    <BCC_ADDRESS>, false));
          message.setHeader("X-Mailer", "JavaMail API");
          message.setSentDate(new Date());
          message.setSubject("Hello JavaMail");
          message.setText("Welcome to JavaMail");
          // Send message
          Transport transport = session.getTransport("smtp");
          transport.connect();
          transport.addTransportListener(this);
          transport.sendMessage(message, message.getAllRecipients());
          transport.close();
          System.out.println("\nMail was sent successfully.");
     public static void main(String[] args) throws Exception {
          MailExample example = new MailExample();
          example.test();
      * (non-Javadoc)
      * @see javax.mail.event.TransportListener#messageDelivered(javax.mail.event.TransportEvent)
     public void messageDelivered(TransportEvent arg0) {
          System.out.println("messageDelivered");
      * (non-Javadoc)
      * @see javax.mail.event.TransportListener#messageNotDelivered(javax.mail.event.TransportEvent)
     public void messageNotDelivered(TransportEvent arg0) {
          System.out.println("messageNotDelivered");
      * (non-Javadoc)
      * @see javax.mail.event.TransportListener#messagePartiallyDelivered(javax.mail.event.TransportEvent)
     public void messagePartiallyDelivered(TransportEvent arg0) {
          System.out.println("messagePartiallyDelivered");
  Regards,
Manu

I agree with japamac.
If you're happy with your Quad G5 and don't plan to upgrade software any time soon, then that is the more economical option. Mini's are great, but I'd say a G5 is more flexible and likely faster and more powerful after you upgrade. I just upgraded the old memory in my dual G5 (from OWC) and that alone has given me a slight speed boost and definitely a stability boost. Can I assume you are planning to use the SSD as a boot disk with your OS and core programs, and a secondary HD as storge for your files?
http://eshop.macsales.com/shop/SSD/OWC/Mercury_6G/
http://eshop.macsales.com/shop/SSD/PCIe/OWC/Mercury_Accelsior/RAID
For what it's worth, I've heard good things about Momentus hybrid drives as well. Nearly the performace of a SSD, with more storage and a lower price tag. I can't speak to compatibility with your system though.
http://www.seagate.com/internal-hard-drives/laptop-hard-drives/momentus-xt-hybri d/
Message was edited by: Kort

Similar Messages

  • Should i get a antivirus for my mac pro

    should i get a antivirus for my mac pro?

    1. This comment applies to malicious software ("malware") that's installed unwittingly by the victim of a network attack. It does not apply to software, such as keystroke loggers, that may be installed deliberately by an intruder who has hands-on access to the victim's computer. That threat is in a different category, and there's no easy way to defend against it. If you have reason to suspect that you're the target of such an attack, you need expert help.
    2. All versions of OS X since 10.6.7 have been able to detect known Mac malware in downloaded files, and to block insecure web plugins. This feature is transparent to the user, but internally Apple calls it "XProtect." The malware recognition database is automatically checked for updates once a day; however, you shouldn't rely on it, because the attackers are always at least a day ahead of the defenders.
    The following caveats apply to XProtect:
    It can be bypassed by some third-party networking software, such as BitTorrent clients and Java applets (see below.)
    It only applies to software downloaded from the network. Software installed from a CD or other media is not checked.
    3. Starting with OS X 10.7.5, there has been another layer of built-in malware protection, designated "Gatekeeper" by Apple. By default, applications and Installer packages downloaded from the network will only run if they're digitally signed by a developer with a certificate issued by Apple. Software certified in this way hasn't actually been tested by Apple (unless it comes from the Mac App Store), but you can be reasonably sure that it hasn't been modified by anyone other than the developer. His identity is known to Apple, so he could be held legally responsible if he distributed malware. For most practical purposes, applications recognized by Gatekeeper as signed can be considered safe.
    Gatekeeper doesn't depend on a database of known malware. It has, however, the same limitations as XProtect, and in addition the following:
    It can easily be disabled or overridden by the user.
    A malware attacker could get control of a code-signing certificate under false pretenses, or could find some other way to evade Apple's controls.
    For more information about Gatekeeper, see this Apple Support article.
    4. Beyond XProtect and Gatekeeper, there’s no benefit, in most cases, from any other automated protection against malware. The first and best line of defense is always your own intelligence. All known malware circulating on the Internet that affects a fully-updated installation of OS X 10.6 or later takes the form of so-called "trojan horses," which can only have an effect if the victim is duped into running them. The threat therefore amounts to a battle of wits between you and the malware attacker. If you're smarter than he thinks you are, you'll win.
    That means, in practice, that you never use software that comes from an untrustworthy source. How do you know whether a source is trustworthy?
    Any website that prompts you to install a “codec,” “plug-in,” "player," "extractor," or “certificate” that comes from that same site, or an unknown one, is untrustworthy.
    A web operator who tells you that you have a “virus,” or that anything else is wrong with your computer, or that you have won a prize in a contest you never entered, is trying to commit a crime with you as the victim. (Some reputable websites did legitimately warn visitors who were infected with the "DNSChanger" malware. That exception to this rule no longer applies.)
    Pirated copies or "cracks" of commercial software, no matter where they come from, are unsafe.
    Software of any kind downloaded from a BitTorrent or from a Usenet binary newsgroup is unsafe.
    Software with a corporate brand, such as Adobe Flash Player, must be downloaded directly from the developer’s website. If it comes from any other source, it's unsafe.
    5. Java on the Web (not to be confused with JavaScript, to which it's not related, despite the similarity of the names) is a weak point in the security of any system. Java is, among other things, a platform for running complex applications in a web page, on the client. That was never a good idea, and Java's developers have had a lot of trouble implementing it without also creating a portal for malware to enter. Past Java exploits are the closest thing there has ever been to a Windows-style "virus" affecting OS X. Merely loading a page with malicious Java content could be harmful. Fortunately, Java on the Web is mostly extinct. Only a few outmoded sites still use it. Try to hasten the process of extinction by avoiding those sites, if you have a choice.
    Java is not included in OS X 10.7 and later. Discrete Java installers are distributed by Apple and by Oracle (the developer of Java.) Don't use either one unless you need it. Most people don't. If Java is installed, disable it — not JavaScript — in your browsers. In Safari, this is done by unchecking the box marked Enable Java in the Security tab of the preferences dialog.
    Regardless of version, experience has shown that Java on the Web can't be trusted. If you must use a Java applet for a specific task, enable Java only when needed for the task and disable it immediately when done. Close all other browser windows and tabs, and don't visit any other sites while Java is active. Never enable Java on a public web page that carries third-party advertising. Use it only on well-known, password-protected, secure websites without ads. In Safari 6 or later, you'll see a lock icon in the address bar with the abbreviation "https" when visiting a secure site.
    Follow these guidelines, and you’ll be practically as safe from malware as you can be.
    6. Never install any commercial "anti-virus" or "Internet security" products for the Mac, as they all do more harm than good, if they do any good at all. If you need to be able to detect Windows malware in your files, use the free software ClamXav — nothing else.
    Why shouldn't you use commercial "anti-virus" products?
    Their design is predicated on the nonexistent threat that malware may be injected at any time, anywhere in the file system. Malware is downloaded from the network; it doesn't materialize from nowhere.
    In order to meet that nonexistent threat, the software modifies or duplicates low-level functions of the operating system, which is a waste of resources and a common cause of instability, bugs, and poor performance.
    By modifying the operating system, the software itself may create weaknesses that could be exploited by malware attackers.
    7. ClamXav doesn't have these drawbacks. That doesn't mean it's entirely safe. It may report email messages that have "phishing" links in the body, or Windows malware in attachments, as infected files, and offer to delete or move them. Doing so will corrupt the Mail database. The messages should be deleted from within the Mail application.
    ClamXav is not needed, and should not be relied upon, for protection against OS X malware. It's useful only for detecting Windows malware. Windows malware can't harm you directly (unless, of course, you use Windows.) Just don't pass it on to anyone else.
    A Windows malware attachment in email is usually easy to recognize. The file name will often be targeted at people who aren't very bright; for example:
    ♥♥♥♥♥♥♥♥♥♥♥♥♥♥!!!!!!!H0TBABEZ4U!!!!!!!.AVI♥♥♥♥♥♥♥♥♥♥♥♥♥♥.exe
    ClamXav may be able to tell you which particular virus or trojan it is, but do you care? In practice, there's seldom a reason to use ClamXav unless a network administrator requires you to run an anti-virus application.
    8. The greatest harm done by anti-virus software, in my opinion, is in its effect on human behavior. It does little or nothing to protect people from emerging threats, but they get a false sense of security from it, and then they may behave in ways that expose them to higher risk. Nothing can lessen the need for safe computing practices.
    9. It seems to be a common belief that the built-in Application Firewall acts as a barrier to infection, or prevents malware from functioning. It does neither. It blocks inbound connections to certain network services you're running, such as file sharing. It's disabled by default and you should leave it that way if you're behind a router on a private home or office network. Activate it only when you're on an untrusted network, for instance a public Wi-Fi hotspot, where you don't want to provide services. Disable any services you don't use in the Sharing preference pane. All are disabled by default.

  • Should I get a router for security?

    My iMac connects to the Internet using a DSL modem through SBC/Yahoo with a static IP address.
    I've never used a router...should I get one for security? (I wouldn't get a wireless probably.)
    If I get a router, what steps are necessary to install it. Different network preferences?
    I know nothing (never gave a router any thought in seven years of DSL service). Thx.

    Dianne, I see you have another post on the same matter. Aside from the advice given there why not unplug the router at either end? If it still works then, tell us the make as it is a remarkable device. This ignoramus has often used the unplug to stop a connection either from a router to the internet or computer to printer or whatever, rather than consider some complicated manipulation of the software. The only other use for the router I can see is direct connection between computers and you don't suggest that.
    Here in the UK the BT network which handles part of the internet route sometimes does not drop for some time after breaking the connection and the persistant links cause a "stale" connection and a failure to reconnect. The usual advice is to wait 30 mins before logging on again. That is the only snag with my cheap and nasty disconnection.

  • Should I get Microsoft office for my new MBP?

    I ordered my MPB 13" online and added iWork. It was much cheaper than Microsoft Office and looked nice and fancy Should I get Microsoft Office too? I had it on my old laptop (not a mac).
    I'm a university student so I am unsure if iWork will be as compatable with lecture ppts and notes etc.
    Any suggestions?

    It may depend on what your major is, but iwork should be an excellent program for your use at college. I've used both Microsoft office and iWork for years. iWork is much more intuitive than MS office and is less $. You can save documents from iWork in MS office format. I've heard there are some advanced features in MS office that iWork doesn't have, but I've never needed them in my professional use.
    You might try iWork and see how it works and if you need to get MS office in the future it's pretty inexpensive since you are a student.
    Good luck.
    M.

  • Should I get antiviral protection for MacBook?

    I am new to Apple computers.  I am used to getting antiviral/malware protection in the past.  I know the Apple reputation is excellent, but what do you think?

    At this time there are no known viruses in the wild that will affect a Mac running Mac OS X. None, nada, zip, zilch. That doesn't mean that it'll never happen, but right now you don't need to worry.
    One thing you should be careful of, though, is downloading and installing software from untrusted sources. If a web site tells you that you have to have their software to guard or clean up your Mac, get out of there immediately and do NOT install anything from them. Mac Keeper and Mac Defender are two examples of the problems you can get this way.
    If you download applications, be sure you get them directly from trusted developers. I can't tell you how many time's I've seen people say they have the Mac App store on their own site for you to download and install. Maybe it's the same code as the original, maybe not. Can you imagine putting your credit card info into such a program?
    If you want to run an anti-virus program to make sure you don't pass on PC viruse in your mail (which is a possibility) you might want to consider ClamXav. It's free and well known to the Mac community.
    Best of luck.

  • Should I get Virus Software for MBP

    I am new to MBPs and i have heard people saying that Macbooks dont get viruses and i am curious. Should i still buy virus software For my Mac?
    I have no idea if i need too. So i would prefer some help

    You really dont have to worry much about viruses on macs (as of yet) as there are only a handfull lurking around which dont really cause any serious problems. I found that when i had AV software running, it would basically inhale my computer's resources like it was a starving child in an all you can eat sushi bar. So i ended up just removing it and let bygones be bygones. Though as the previous poster said, you can use free stuff like ClamXav or whatever it was called, or if you're in university, some U's provide free AV software somewhere on their sites. My 2 cents says dont worry about it.

  • Why do i get classcast exception for this code

    import java.util.*;
    public class Test1{
    public static void main(String a[]){
    Set s = new TreeSet();
    s.add(new Person(20));
    s.add(new Person(10));
    System.out.println(s);
    class Person{
    Person(int i){}
    }

    basically classcast exception is thrown when the class can not be casted with the proper form that is demanded.
    1> in case of set the value should be mutually comparable. but unfortunately in you code you have not implemented comparable interface. you should implement that interface.
    2> after using the comparable interface you should implement the method <class object 1>.compateTo(<class object 2>)
    the above two process should exclude the exception from you code hopefully.
    check out!

  • Should I get internet security for my mac? 2014

    I use my mac everyday surfing the internet, downloading music, and streaming movies or sites that I'd normally be scared of using on a PC. I've recently switched over to the mac and am a complete newb right now in need of hlep. (macbook pro 13" retina with OSX Mavericks 10.9.2 and using safari 7.0.2)
    I've tried doing some google research and looking on here for other discussions but none really gave a straight answer, or people were in dispute over the topic. If any of you knowledgeable apple people can shed some light for me, please do.

    As Linc very rightly points out, if you are downloading or streaming music and movies illegally, sooner or later that will result in some kind of infection. Right now, many people who do such things seem to be ending up infected with adware. Think about it this way: the people who are making those files available are criminals. Do you really think you should trust the integrity of a file that you obtained from a criminal?
    For more information on protecting yourself, see my Mac Malware Guide.

  • Should I get a warranty for my beats by Dre?

    I got the wireless studio beats by Dre for 320 dollars since I matched it with Walmart so I saved about 80 dollars but the clerk told me I can't get a warranty since the beats I got are a limited edition and it is out dated. She said I have 15 days to return them. Should I just kee the beats without the warranty? Or should I return them?

    Hello Lakeeshow310,
    I have had many customers express their love for the Beats Studio Wireless headphones, and I've heard very few complaints about their performance. I'm also glad you were able to get the best deal on them by taking advantage of our Price Match Guarantee!
    Regrettably, as of early January, Best Buy is no longer offering Geek Squad Protection Plans on any Beats headphones. This means that the only warranty on the headphones is through the manufacturer. I don't imagine you will have any issues with them, but if you choose to take another route and choose a different pair of headphones, you can always make a return or exchange within our Return/Exchange Promise policy.
    Best wishes and enjoy the new headphones!
    Sam | Best Buy Multi-Channel Sales Associate
    I am an active employee of Best Buy. While here to help, the opinions presented by me on this site do not represent the views or decisions of Best Buy and its affiliates. Authorized company representatives identified with -BBY after their names are able to address specific concerns or inquiries in greater detail.
    Forum Guidelines | Price Match Guarantee | Return & Exchange PromiseRemember to mark your questions solved and click the star to give kudos to show your thanks!

  • Cannot use iTunes to transfer music files except for one computer login.

    Info: We have 2 laptops in our home, both on Windows Vista SP2. Both iTunes 10.5. I recently got an iPhone 4 with iOS 5.0.1, on Verizon, 8 GB.
    I have only one Apple ID as far as I can tell, but I do remember being forced to change my login name to an email address, and make my password more complex. During that time, I think my other laptop was inoperative. I had to install a new hard drive and reinstall Windows and all apps from scratch. The two laptops do not have identical music libraries.
    Apps sync only on the first computer and user login I used the iPhone on. The other computer doesn't show the same apps and warns me that if I sync with it I might replace the apps on the phone with what's in its apps list. How do you ensure that either laptop can sync the iPhone without wiping the content off? I want to backup to both laptops.
    I cannot transfer any of my music files from the second laptop at all. I get a cursor with the red slash circle. I can transfer files on the original computer, but I have to be logged on as the one computer user account. It's like every connection except this one computer account can maintain my iPhone properly.
    Anyone else have a similar problem or have a fix?

    Use only one computer as the mother ship to sync with a device.

  • What time should I get in line for iphone 4s

    I am planning to purchase an iphone 4s 32GB white on October 14th
    I will go to the Apple store in Brea, CA and hope to know what time I should get in line by
    I also wanted to switch my individual plan for iphone 4 to the family plan and add iphone 4s to my account
    Is that possible??  I also did not pre-order but plan to get it right at the Apple store....will it work ??

    I suggest you call that store and ask them. they know their past history, what lines are allowed at their location, etc.
    For expediency, you may want to have all that switching set up prior to purchasing the phone. Contact your carrier and see if they can do that for you ahead of time.
    Apple Store can get that family plan, but only at time of purchase.

  • How do I use CreateBookmarksFromGroupTree and NOT get a "temp_" for my top level?

    I have a report that I have created that uses uses groups and I wanted export a PDF using the CreateBookmarksFromGroupTree option. While that works, I get an ugly top level bookmark name that starts with "temp_" then followed by two GUIDs "temp_13fef8e3-30ec-4bc5-ba77-b55d23c95e8f {87823BCB-7789-407C-8A7F-5096BE07A83E}".
    So, how do I:
    1) Get rid of this top level so it matches the Crystal Viewer (which has multiple top level bookmarks)
    2) Put in a name of my own choosing as the top-level bookmark.
    <!break>
    Any help or suggestions would be appricated.
    Thanks,
    Jim

    I would very much like to know how to avoid this also!!!

  • New iPad 2 error -48 before I've even started using it should i get it exchanged?

    i've just purchased a new ipad 2 and before even using it i get the -48 error and to be honest it's put me off it, I've spoken to the apple store in which i bought it from only to be told book a genius appointment and they'll check it needless to say im not happy i want this unit swopping am i right in thinking this or am i just over reacting

    What were you doing when you got the -48 error message ? If you were trying to download and update to iOS 5 then see if this page helps : http://support.apple.com/kb/TS3694#error48

  • I pay new i phone 6 should i get i life for free ?

    Dears
    I pay new iphone 6 but when I make the backup from i cloude i can not finde i life ( i photo , pages . Etc )

    MY phone 64gb
    if i try to downlode from app store I will pay money for it

  • Should I get virus protection for iPad?

    Is anti-virus software needed for iPad?

    Didn't think so.  Just checking in case I fall behind the times.  Thanks.

Maybe you are looking for

  • Report of PO changess

    Hi Friends, I need to see a report which show me the changes made in POs so far. If I have changed the PO 3 times, the report should show me the number of times the PO changed and what are the changes and on which date by whom... Please advise me how

  • Yahoo! Mail subfolders

    I have set up my email through the link on the homescreen when you first turn on the phone. It is delivering the mail all fine and well, but it will not show the subfolders that I have on my regular mail (folders that I have created filters for). I g

  • IMporting multiple albums at once: sort on date added AND album or artist

    When importing multiple albums at once, iTunes ads them in the library in an all mixed up order. This makes it very annoying to change song info. I have to multi-select songs from the same album (clicking while pressing the control button) and then c

  • Why can't I find/access my recent downloads and imessage with the new IOS software update?

    I just recently updated my phone to the new IOS 7 software. I had to do this using my computer. It updated ok but now when I try to find apps that I downloaded (from the computer again) I am unable to locate them. I did find one app that was download

  • POV and User POV in Web Analysis 9.3

    Hi, I am a bit confused with POV and User POV in Web Analysis 9.3.1. I have a few web analysis dashboard to be used by several different groups of users. I use the admin to go in and for each of the report, I set whether need to use User POV (in data