Hi,
I am trying to send mail thru outlook. I have found some code on the web and
ws trying it out. I was successful in creating a mail in the draft folder of
outlook, however hangs for a long time during the sending of the mail.
Snippet code as below
-------------------------------------------
using Outlook = Microsoft.Offic e.Interop.Outlo ok; //using the 11.0 object
library
private Outlook.Applica tion oApp = null;
private Outlook.NameSpa ce oNameSpace = null;
private Outlook.MAPIFol der oOutboxFolder = null;
oApp = new Outlook.Applica tion();
oNameSpace= oApp.GetNamespa ce("MAPI");
oNameSpace.Logo n(null,null,tru e,true);
oOutboxFolder =
oNameSpace.GetD efaultFolder(Ou tlook.OlDefault Folders.olFolde rOutbox);
Outlook.MailIte mClass mi =
(Outlook.MailIt emClass)oApp.Cr eateItem(Outloo k.OlItemType.ol MailItem);
mi.To = "te**@test.com" ;
mi.Body = "Some Message";
mi.Subject = "Some Title";
mi.SaveSentMess ageFolder = oOutboxFolder;
mi.Save(); //works where i am able to see the mail in the draft folder
mi.Send(); //does not execute where the web page just stalls
-------------------------------------------------
Any help why this is happening, if the save() works, why does the send just
stalls and does not drop a mail in the outbox for sending.
Is there any settings on the server side which i miss?
I am running everything below on the same pc :-
Windows Server 2003 Enteprise Ed
..NET 1.1 Framework
MS IIS 6
MS Exchange 2003
Office 2003(Outlook 2003 and etc)
Thanks,
Joey 1 4894
Just a guess, but when using the Outlook Interop in this way you must give it
explicit commands. It's possible that you're sending the mail item to the
outbox with send, but not performing a send/receive.
Any reason you didn't just use the SMTP class???
Ryan
"Joey Lee" wrote: Hi,
I am trying to send mail thru outlook. I have found some code on the web and ws trying it out. I was successful in creating a mail in the draft folder of outlook, however hangs for a long time during the sending of the mail.
Snippet code as below -------------------------------------------
using Outlook = Microsoft.Offic e.Interop.Outlo ok; //using the 11.0 object library
private Outlook.Applica tion oApp = null; private Outlook.NameSpa ce oNameSpace = null; private Outlook.MAPIFol der oOutboxFolder = null;
oApp = new Outlook.Applica tion(); oNameSpace= oApp.GetNamespa ce("MAPI"); oNameSpace.Logo n(null,null,tru e,true); oOutboxFolder = oNameSpace.GetD efaultFolder(Ou tlook.OlDefault Folders.olFolde rOutbox);
Outlook.MailIte mClass mi = (Outlook.MailIt emClass)oApp.Cr eateItem(Outloo k.OlItemType.ol MailItem); mi.To = "te**@test.com" ; mi.Body = "Some Message"; mi.Subject = "Some Title"; mi.SaveSentMess ageFolder = oOutboxFolder; mi.Save(); //works where i am able to see the mail in the draft folder mi.Send(); //does not execute where the web page just stalls
-------------------------------------------------
Any help why this is happening, if the save() works, why does the send just stalls and does not drop a mail in the outbox for sending.
Is there any settings on the server side which i miss?
I am running everything below on the same pc :- Windows Server 2003 Enteprise Ed ..NET 1.1 Framework MS IIS 6 MS Exchange 2003 Office 2003(Outlook 2003 and etc)
Thanks,
Joey This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: guy lateur |
last post by:
Hi all,
I am trying to write some code (macro's, if you like) to glue together
our Office applications (mainly Word, Excel and Outlook). We have a lot
of different projects going on simultaneously. The idea is to develop a
centralized framework (starting point, common interface) for my users
to view/control their documents/correspondence, on a per project basis.
As an example, I'd like to have a control (button, menu entry) in
Outlook...
|
by: W Akthar |
last post by:
Hi All,
I have created a simple Windows Service which needs to be
able to send appointments to Outlook.
I have no problem makeing a reference to Microsoft
Outlook 11.0 Object Library and compiling the code. the
problem arises when I try to install the service using
installutil.
The error message I get is the following
|
by: John |
last post by:
Hi
Does anyone have a vb.net example of how to use redemption to send mail
through outlook?
Many Thanks
Regards
|
by: Srinivas |
last post by:
hi all
how to access the outlook user profiles through VB.net
any help....
thanks in advanc
Srinivas
|
by: Brett |
last post by:
When I run this line:
myolApp = CreateObject("Outlook.Application")
The myolApp object has a value of {Outlook.ApplicationClass}. When I expand
it in the watch window, all properties/methods of that object have a value
of
<error: an exception of type: {System.InvalidCastException} occured>
I'm referencing the Outlook 10.0 Object Library (Interop.Outlook), which
| |
by: JC |
last post by:
Anybody knows what problem has this code? I think, in the Garbage
Collector? You know the Solution?
The program in the test's case, whit 350 contacts, run OK before number
86. The error is a "Array index out of bounds".
Microsoft.Office.Interop.Outlook._Application olApp = new
Microsoft.Office.Interop.Outlook.ApplicationClass();
Microsoft.Office.Interop.Outlook._NameSpace olNs =
olApp.GetNamespace("MAPI");
|
by: mwolowski |
last post by:
Hello,
I'd like to add tasks, appointments, etc using c# to outlook
For example i added reference
using OutLook = Microsoft.Office.Interop.Outlook;
and the code:
1.
---------------------
OutLook._Application outlookObj = new OutLook.Application();
|
by: =?Utf-8?B?cm9i?= |
last post by:
C#.Net Outlook 2003 automation (programmatically) with Office.Interop.Outlook
Problem:
I have my outlook 2003 configured with multiple mailbox on my local machine.
I want to specify the mailbox and server (Exchange server mail box)
to connect and then save the mailitems(from Inbox or any other folder)
based on a filter to a*.msg file.
I want to achieve this using only one Interop dll if this is possible.
Tried so far:
|
by: allbelonging |
last post by:
C#.Net Outlook 2003 automation (programmatically) with Office.Interop.Outlook
Problem:
I have my outlook 2003 configured with multiple mailbox on my local machine.
I want to specify the mailbox and server (Exchange server mail box)
to connect and then save the mailitems(from Inbox or any other folder)
based on a filter to a*.msg file.
I want to achieve this using only one Interop dll if this is possible.
Tried so far:
|
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...
|
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,...
| |
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...
|
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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...
|
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...
|
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
| |
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...
| |