VBScript abort when outlook is closed.

Hello, I am using the folowing vbscript to send email. It works fine only when the outlook is open in the machine, the operation is aborted when the outlook is closed. Any suggestion on it? I thought the script should start outlook by itself
if the is not running. Thanks for your help! 
Set MyApp = CreateObject("Outlook.Application")
Set MyItem = MyApp.CreateItem(0)
With MyItem
.To = "[email protected]"
.Subject = "Subject"
.ReadReceiptRequested = False
.HTMLBody = "MessageLine 2"
End With
MyItem.Send

if you have a valid SMTP server you could use the following 
Dim mailer : Set mailer = CreateObject("CDO.Message")
mailer.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
mailer.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtpserver.domain.com" 
mailer.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
mailer.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendemailaddress") = "[email protected]"
mailer.Configuration.Fields.Update
mailer.From = "[email protected]"
mailer.To = "[email protected]"
mailer.Subject = " subject"
mailer.Textbody = "contenttext"
mailer.AddAttachment "C:\temp\attachment.txt"
mailer.Send

Similar Messages

  • Programmatically backup outlook pst file when outlook is in use

    Hello,
    I want to develop utility to take backup of outlook pst file automatically even if outlook is in use.  When outlook is closed then I am able to copy pst file but when outlook is in use then its showing error "The process can not access the file
    because another process has locked a portion of the file".  
    Does anyone have idea how to programmatically copy pst file even if outlook is open? Another question is does anyone have idea of incremental backup of pst file?
    Please give some idea if you know the answer.... Its really very urgent..
    Akshay Shah

    Hi,
    You erroneously posted your question on the Project forum which is dedicated to the Microsoft scheduling and planning application.
    Please post it on the right forum to have appropriate help, starting from here:
    https://social.technet.microsoft.com/Forums/en-US/home?forum=whatforum
    Hope this helps,
    Guillaume Rouyre, MBA, MVP, P-Seller |

  • Messages stuck in outbox when using "Send to Mail recipient" and outlook is closed

    A user who uses RPC over https all the time on his desktop in the office. In general
    he has no problem to send/receive emails. But when he tried to send a File through right click - > send to -> Mail recipient , New Email window opens and He changes
    the subject and add receipt and send email when outlook is close. The email stuck in outbox.
    any idea and how to fix it?
    Thanks in advance. 

    Hi,
    As what Roady says, it is an expected behavior. This is because the
    “spooler” which is something that manages the MAPI transports is working when Outlook is running. So when you sending messages when Outlook is not running, there is no spooler running, and so nothing is going to send your mail. The next time you launch Outlook,
    you will see the mail in the Outbox.
    For more information about this behavior, please refer to A trip back in time—the evolution of Outlook part of the following link:
    http://blogs.technet.com/b/office_resource_kit/archive/2013/08/15/the-mysterious-outlook-outbox.aspx
    Regards,
    Winnie Liang
    TechNet Community Support

  • Not Receiving Emails on BB when Outlook is Open

    Hi,
    I only get emails delivered to my blackberry only when my Outlook is closed. 
    Only on few occasions, I will get 1-2 emails on my blackberry when Outlook is open.
    I tried deleting all my accounts on the BIS website and re-created the accounts and this problem still persists.
    Further, the emails that arrive in my blackberry are removed every few days such that they only show the emails that I had sent from my blackberry.
    I am using:
    Blackberry 8320 v4.5.0.55
    Windows XP Pro SP3
    Outlook 2007
    Messages set to be left on Internet Provider Server
    BIS
    3 POP3 Email Accounts
    Thanks!

    I have a client who is experienceing a very similiar issue. 
    He is using a hosted Exchange server through GoDaddy for his primiary email.  At first he had issues getting any email whatsoever on his BB so we worked through some things and now it is capable of receiving emails.  
    He can send emails just fine at any point from his device but the issue comes when he wants to get an email.  If Outlook is open he is unable to receive the message on BlackBerry, but as soon as he closes Outlook, he is able to receive any new emails sent while Outlook is closed.  I At first thought it looks like his settings on Outlook do not leave the messages on the server, but as I thought about it, this did not make sense as he is using an Exchange server.  I thought Exchange servers left the mail on the server until deleted by the user.  Is this not the case?  And would the fact that it is a hosted server have any effect?
    We have it setup through BIS, OWA account
    Right now the only solution I have for him is to close Outlook when he leaves the office.  I can not figure out what the issue is, even though it is likely something small that I am just missing.  Any help is greatly appreciated.

  • Emails not pushing when outlook is open

    Ladies & Gentlemen,
       I need some advice on how to fix a problem.  When my outlook program on my pc is open, my mail will not push to my phone, even when I have the frequency set to 15mins.  How can I fix this.  Whenever my outlook is closed all my messages push just fine, it's just when outlook is open is when they don't sync. The only way they will push when outlook is open is when  I send the email(to my comcast acct) and continue to push the "refresh" button. But I don't have this issue with my google acct.  Please assist. Just incase someone ask.  I've had this problem with three different driod phone, with and without the  software updates.
    PC -Windows Vista
    Outlook - 2007
    Cell - Eris Droid
    Email - Comcast,net (POP3)

    You may just want to say Remove Email after X days. By not removing your email most carries restrict mailbox size and you will allow it to fill up and then stop newemails from arriving. so You may want to choose Remove emails after say 3 days this way you get it on the phone and on the PC. I run mine at 1 day but thats just me....
    Thanks
    Mike

  • Blackberry won't receive messages when Outlook 2007 is open

    Ok guys, I was facing a problem of emails not getting delivered when Outlook 2007 was open. Did some online research and found following: 
    Black berry internet services no longer support POP3 access, refer here http://www.blackberry.com/btsc/search.do?cmd=displayKC&docType=kc&externalId=KB17407
    Now, the only option is to enable IMAP in Google Apps/ Gmail. I configured my gmail using directions here: http://mail.google.com/support/bin/answer.py?answer=78882
    and for Outlook 2007, I configured IMAP settings using directions here: http://mail.google.com/support/bin/answer.py?answer=77689
    Finally, I am getting emails both on Blackberry as well as Outlook 2007, without any synchronization problems. Issue closed!
    PS: No need to reply. Just posting for benefit of the community.

    Do a back up of your BBMessenger first (BBM > options > backup).
    Delete BBMessenger from Options > Advanced > Applications.
    Do a simple reboot on the BlackBerry in this manner: With the BlackBerry device POWERED ON, remove the battery for a minute, and then reinsert the battery to reboot.
    Now, download and reinstall BBM from www.blackberry.com/bbm using your BlackBerry browser.\
    You might need to ask a member in each group to either re-invite you to the group, or delete you from and then re-invite you.
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Why does captivate hang when it is closed in window 8.1 professional ? How is it solved?

    Why does captivate hang when it is closed in window 8.1 professional ? How is it solved?

    Hi,
    Do you see the issue every time you close captivate or is it only in some scenarios? Does it show any error messages? What captivate version are you using (64 bit or 32 bit)? Can you provide some more information or screenshots which can help us reproduce the issue.
    Tamish

  • Using Outlook 2007 I want to receive emails on my iPhone 4 only when Outlook is NOT open on my computer, as when away from home or want to quickly check email when computer is not turned on. Either ALL emails come to my iPhone or none at all.

    Using Outlook 2007 I want to receive emails on my iPhone 4 only when Outlook is NOT open on my computer, as when away from home or want to quickly check email when computer is not turned on. Either ALL emails come to my iPhone or none at all. Is the setting I need to change in Outlook or on the iPhone or is it somewhere else?  I used to have this setting but transferring Outlook to a new laptop somehow turned it off.

    No. You really can't do that. Not easily at any rate. You would have to set them both up to use POP3, but even then there is no way to guarantee that the phone won't poll the server prior to your computer doing so, pulling down the message from the server.

  • I cannot delete cookies after updating to 9.0.1, also when opened, I have 2 new cookie files that disappear when FF is closed.

    I have uninstalled/reinstalled 9.0.1, the same thing happens. Checked my Profile, cookies.sqlite is there when FF is closed or uninstalled. When installed and opened, I have 2 new files, cookies.sqlite-wal and cookies.sqlite-shm, along with cookies.sqlite. Is this the reason I can't delete cookies? Also I have, and have had enabled AdBlock Plus and Privacy Browsing. After updating, I can't post anything to FF Support (this is my 4th attempt, finally used Safari to post) and files under Tools, such as Clear History are accessible, I shouldn't have a History to delete.
    (1st edit)
    OK. I reinstalled FF 9.0.1 from Safari, but not directly from Mozilla. I used CNet, now things are working like they should. I have no cookies listed, except the ones I want. Private Browsing is working properly. However, I still have those 2 extra cookie files; -wal and -shm.
    (2nd edit)
    I spoke too soon. After accessing sites that I frequent, the 'ad' cookies are back (adbright, realmedia, 247realmedia) and the site cookies are eliminated, not there, gone. Now I can't login to anything and am back to Safari to access FF Support Forum. Do I have a bug? Someone please help, I'm desperate, I hate IE, Safari, Chrome, etc. They have neither the level of ad and pop-up elimination that Firefox has; nor, do they have the level of customization that Firefox has. The 2 extra cookie files, -wal and -shm, are still there when FF is open, and gone again when FF is closed. One more thing I noticed, I have a Chrome Support Application file in my Library. Could the Chrome cookie file interfere with FF cookies? I wouldn't think so, I have Safari, as well, and neither browser has ever interfaced with the other before.
    (3rd edit)
    I have uninstalled/reinstalled FF, all of my add-ons and also tried deleting the cookies.sqlite document from the FF Profile file, to no avail. I have counted, there are 14 sites listed in the Preferences>Privacy>Show Cookies pane (no pun intended) and they are all "ad" sites. These sites are also listed as blocked sites in Adblock Plus. Until someone answers, I give up, I don't know what else to do. There was only the one time that the cookies were gone from the Show Cookies pane, every other time I uninstalled/reinstalled anything, they were still there. So, until someone helps me, I'm stuck. The only thing I have not done is deleted the Profile file altogether. That is the last thing I want to do, unless I can save my bookmarks somewhere to move back after reinstallation. If this isn't rectified within a few days, I may just try that, too.

    Do you have an extension like TACO (Abine) or TrackerBlock that maintains a set of OPT-OUT cookies?
    * Targeted Advertising Cookie Opt-Out (TACO): https://addons.mozilla.org/firefox/addon/targeted-advertising-cookie-op/
    * TrackerBlock: https://addons.mozilla.org/firefox/addon/trackerblock/
    * Beef Taco (Targeted Advertising Cookie Opt-Out): https://addons.mozilla.org/firefox/addon/beef-taco-targeted-advertising/
    If you do then you need to disable or uninstall such an extension.
    If clearing the cookies doesn't help then it is possible that the file <i>cookies.sqlite</i> that stores the cookies is corrupted.<br />
    Rename (or delete) <b>cookies.sqlite</b> (cookies.sqlite.old) and delete other present cookie files like <b>cookies.sqlite-journal</b> in the Firefox Profile Folder in case the file cookies.sqlite got corrupted.
    *http://kb.mozillazine.org/Cookies

  • My opening page won't load the home page even though I set it to home page in preferences.  Instead it always opens to the last page I had when I last closed.  I'd like it to open to my home page.  I've tried dumping and reloading Safari, I have 5.1.2.

    My Safari 5.1.2 Just won't open to my home page even though I have it set in preferences.  It continues to open on the last page I was on when I last closed Safari.  What overrides my settings in preferences?

    I just purchased my first MAC after working on PC for the past 25 years and would like to know how to keep my safari program to be the full screen everytime I get into the app. I always have to click the two arrows to the top right of the safari program but on a PC it is always opened in full screen mode ??? and while I have you plugged in how do you make it so that the manu bar does not go away (hyernate??)
    Cheers

  • How can I get my MacBook to stay on and not sleep when lid is closed?

    How can I get my MacBook to stay on and not sleep when lid is closed?

    try this: http://www.macupdate.com/app/mac/37991/nosleep

  • TS1363 Ipod does not appear in my computer or recognized in itunes. When ipod is connected a window pos up aking to import photos off the device and when this is closed the ipod cannot be recognized. Any Help?

    Ipod does not appear in my computer or recognized in itunes. When ipod is connected a window pos up aking to import photos off the device and when this is closed the ipod cannot be recognized. Any Help?

    Which OS are you using? 
    In the meantime, research your problem in Knowledge Base. 

  • Why viber is not working when i am closing the app?

    in my iphone 4 mobile i am facing a problem. when i am closing my apps i am not getting any calls. when i am opening the apps then i am getting calls, sms and miscalls. I am connected with wifi. in this same connection others users are getting calls when they are closing the app. what is my problem? i have uninstalled the app and again i have installed it. but problem remains same. Anyone is not getting me!!!! Please reply as soon as possible.

    Try the stamdard fixes to rule out a software problem:
    - Reset. Nothing will be lost
    Reset iPod touch:  Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Restore from backup
    - Restore to factory defaults/new iPod.

  • When I try to download Adobe Flash Player, it says I need to quit out of Safari even when it's closed. How do I fix this?

    When I try to download Adobe Flash Player, it says I need to quit out of Safari even when it's closed. How do I fix this?

    Apologies for the slightly pedantic answer, but in application terms, "closed" and "quit" are two different things. An application such as Safari can have several windows open, and each of them can be closed using the red button in the corner.
    However, even after all windows are closed, the application is still running until you specifically quit it. You can tell it's still running by the small light under its icon in the Dock. If you hold your cursor down on the icon for a few seconds, you should see a pop up menu with the "Quit" option - click that to quit it. Or, click the icon once (this may launch a new window), then either go to the Safari menu and click Quit, or click cmd-Q, to completely quit the app.
    Matt

  • Spry problems in IE, menus stuttering when opening and closing

    I just intserted some spry collapsible panels into a dreamweaver page I am developing but when I preview the pages in IE8
    the spry menus stutter and shake when opening and closing.
    Does anyone have any idea what is causing this?

    alexk2077 wrote:
    I just intserted some spry collapsible panels into a dreamweaver page I am developing but when I preview the pages in IE8
    the spry menus stutter and shake when opening and closing.
    Does anyone have any idea what is causing this?
    That is strange, I just did the same without any problem.
    I did use the original Spry files (JS and CSS).
    How about you, are you using the original files or are you using your own modified files?
    Ben

Maybe you are looking for

  • How to handle External Jar files in EJB DC

    I have created a EJB DC. I have added the required MDM Jar files to the class path. These MDM Jar files are supplied by SAP for integration with Master Data Management. But the DC build fails. If I create the same project as a <b>REGULAR</b> EJB (non

  • How to get downloaded material off Iphone but leave on Ipad.

    I have downloaded some items for my Ipad.  I same username for both my Ipad and my Iphone.  I don't want these things on my Iphone, just my Ipad.  These include movies, albums etc.  How do I remove them?  I have an Iphone 4s and don't have an option

  • Payment method optional field

    Hi guru's Am creating the service SO in which payment method field is optional,  but still while creating the SO it is ask for payment method mandtory, I check the Incompletion log. In that this field is not mandotary, Can any one help me to finout h

  • Mssqlserver 2014 backup to disk crashing host on windows 2012R2

    Setting up updated mssqlserver host ( older dell R710 ) with windows 2012R2 std and SQL server 2012 Std edition with 96 gb Ram. SQLserver is allocated 64 GB ram. Our user database sizes are 650 Gb and 1.5 Tb .  Data devices reside  in DAS and we use

  • PO Release process item level control

    Hi, Please guys any way to control  Release process at item level based on account assignment any configuration or user exit or bapi. JACK