![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Hobbyist Programmer
Join Date: Mar 2005
Posts: 139
Rep Power: 4
![]() |
Outlook
I have a class library that is supposed to send email from outlook ... i have added a reference to the Microsoft.officecore (something like that) 12 and outlook object library 12 (i have office 2007)...im calling the DLL from a C# class in an ASP.Net application
The code fails here: msg = OutlookApp.CreateItem(OlItemType.olMailItem) 'Mail item Code: Imports Microsoft.Office.Interop.Outlook
Public Class Email_vb
Public Sub sendEmail(ByVal recipient As String, ByVal subject As String, ByVal message As String)
Dim OutlookApp As New Application 'application
Dim msg As _MailItem
msg = OutlookApp.CreateItem(OlItemType.olMailItem) 'Mail item
Dim oNameSpace As Microsoft.Office.Interop.Outlook.NameSpace
oNameSpace = OutlookApp.GetNamespace("MAPI")
msg.To = recipient
msg.Subject = subject
msg.Body = message
msg.Send()
End Sub
End ClassException Details: System.Runtime.InteropServices.COMException was unhandled by user code ErrorCode=-2147467259 Message="The operation failed." Source="Microsoft Office Outlook" StackTrace: at Microsoft.Office.Interop.Outlook.ApplicationClass.CreateItem(OlItemType ItemType) at sendMail.Email_vb.sendEmail(String recipient, String subject, String message) in E:\Documents and Settings\Paul\My Documents\Visual Studio 2005\Projects\sendMail\sendMail\Class1.vb:line 10 at Capstone.Email.sendEmail(String recipientEmail, String message, String subject) in F:\capstone_vs_project\Capstone\Capstone\Email.cs:line 23 at Capstone.BestOffer.alertSeller(String sellersName, String sellersEmail) in F:\capstone_vs_project\Capstone\Capstone\BestOffer.cs:line 216 at Capstone.BestOffer.contactSeller() in F:\capstone_vs_project\Capstone\Capstone\BestOffer.cs:line 186 at Capstone.BestOffer.addOffer(Double offerPrice) in F:\capstone_vs_project\Capstone\Capstone\BestOffer.cs:line 80 at Capstone.preview.submitBestOffer_Click(Object sender, EventArgs e) in F:\capstone_vs_project\Capstone\Capstone\preview.aspx.cs:line 280 at System.Web.UI.WebControls.Button.OnClick(EventArgs e) at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Screen Scraping | tayspen | C# | 8 | Feb 15th, 2006 9:36 PM |
| What is the outlook on outsourcing? | dvu | Coder's Corner Lounge | 5 | Nov 19th, 2005 2:29 PM |
| Automating a response in outlook | Mjordan2nd | Other Programming Languages | 5 | Jan 31st, 2005 11:36 PM |
| Application Hooks in C? | robert_sun | C++ | 0 | Jan 12th, 2005 4:44 PM |
| WAB sharing | robert_sun | Existing Project Development | 2 | Jan 11th, 2005 10:47 AM |