Top DevX Stories
Apple Seeds iOS 4.1 SDK as App Downloads Top 6.5 Billion
Google TV Developer Platform: What to Expect
Here Comes the Decade of the Developer
Red Hat is Still the Best Linux Server Choice
As Oracle Sues Google Over Java, Developers Move to Other Languages
Search the forums:

Go Back   DevX.com Forums > DevX Developer Forums > ASP.NET

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 04-29-2006, 04:52 AM
jabbarsb jabbarsb is offline
Registered User
 
Join Date: Jun 2004
Location: Saudi Arabia
Posts: 63
Talking Opening Outlook from Asp.net

Hi friends,
I am in need to open ms-outlook from asp.net application can anybody help me in this can you send the code and the address of the receipent should come in the To option of the outlook application

regards,
Jabbar
Reply With Quote
  #2  
Old 04-29-2006, 10:09 AM
Phil Weber Phil Weber is offline
Super Moderator
 
Join Date: Nov 2003
Location: Portland, OR
Posts: 8,322
ASP.NET code runs on the Web server. If you open Outlook from ASP.NET, it will open on the Web server, not on the user's computer. Is that what you want?

If you want the user to click a link and have an e-mail open with a specific address in the To field, you can simply use a mailto link:

<a href="mailto:address@domain.com">Click here to send an e-mail</a>
__________________
Phil Weber
http://www.philweber.com

Please post questions to the forums, where others may benefit.
I do not offer free assistance by e-mail. Thank you!
Reply With Quote
  #3  
Old 07-10-2006, 08:50 AM
jabbarsb jabbarsb is offline
Registered User
 
Join Date: Jun 2004
Location: Saudi Arabia
Posts: 63
Talking

thanks for the reply,
now i am in need to give email address from my application
to the outlook form so instead of <a href="mailto:address@domain.com"> what shall i write to get address instead of address@domain.com to my supplied address also i need to put automatically cc,bc and subject from my application to the outlook form

regards jabbar
Reply With Quote
  #4  
Old 07-10-2006, 10:02 AM
Phil Weber Phil Weber is offline
Super Moderator
 
Join Date: Nov 2003
Location: Portland, OR
Posts: 8,322
http://www.google.com/search?q=mailto+syntax
__________________
Phil Weber
http://www.philweber.com

Please post questions to the forums, where others may benefit.
I do not offer free assistance by e-mail. Thank you!
Reply With Quote
  #5  
Old 07-23-2006, 09:40 PM
dkandersack dkandersack is offline
Registered User
 
Join Date: Jul 2006
Posts: 1
this is how i do it

this should spawn on the client machine not the web server. but then again im using an all in one so ....
dont forget to import the outlook namespace at the top of your codebehind page

Imports outlook

Dim objOutlk As New Outlook.Application 'Outlook
Const olMailItem As Integer = 0
Dim objMail As New System.Object
objMail = objOutlk.CreateItem(olMailItem) 'Email item
objMail.To = emaila.Text
objMail.cc = "" 'Enter an address here To include a carbon copy; bcc is For blind carbon copy's
'Set up Subject Line
objMail.subject = "Quality Assurance Letter"
'To add an attachment, use:
'objMail.attachments.add("C:\MyAttachmentFile.txt")
dim msg as string
msg = "body test msg"
objMail.body = msg
'Use this To display before sending, otherwise call objMail.Send to send without reviewing
objMail.display()
'Use this To display before sending, otherwise call objMail.Send to send without reviewing
'Clean up
objMail = Nothing
objOutlk = Nothing

hope this helps
dan
dkandersack@hotmail.com

Last edited by dkandersack; 07-23-2006 at 09:41 PM. Reason: added imports
Reply With Quote
  #6  
Old 05-26-2008, 08:38 AM
haivijaykumar haivijaykumar is offline
Registered User
 
Join Date: May 2008
Posts: 2
Smile Issue with the OUTLOOK Code in C#

Hi,

I have used the code which you have posted in VB.NET in C# ,iam getting following Errors.

Error 40 'object' does not contain a definition for 'To' E:\WWT\Example\OurlookMail.aspx.cs 34 21 E:\WWT\
Error 41 'object' does not contain a definition for 'cc' E:\WWT\Example\OurlookMail.aspx.cs 35 21 E:\WWT\
Error 42 'object' does not contain a definition for 'subject' E:\WWT\Example\OurlookMail.aspx.cs 38 21 E:\WWT\
Error 43 'object' does not contain a definition for 'body' E:\WWT\Example\OurlookMail.aspx.cs 43 21 E:\WWT\
Error 44 'object' does not contain a definition for 'display' E:\WWT\Example\OurlookMail.aspx.cs 45 21 E:\WWT\

Here is My C# Code:
Outlook.Application objOutlk = new Outlook.Application();
//Outlook
const int olMailItem = 0;
object objMail = new object();
objMail = objOutlk.CreateItem(olMailItem);
//Email item
objMail.To = emaila.Text;
objMail.cc = "";
//Enter an address here To include a carbon copy; bcc is For blind carbon copy's
//Set up Subject Line
objMail.subject = "Quality Assurance Letter";
//To add an attachment, use:
//objMail.attachments.add("C:\MyAttachmentFile.txt")
string msg;
msg = "body test msg";
objMail.body = msg;
//Use this To display before sending, otherwise call objMail.Send to send without reviewing
objMail.display();
//Use this To display before sending, otherwise call objMail.Send to send without reviewing
//Clean up
objMail = null;
objOutlk = null;


Please reply me the action which i need to take.

Thanks in Advance...


Vijay
Reply With Quote
  #7  
Old 05-26-2008, 08:45 PM
dglienna dglienna is offline
Registered User
 
Join Date: May 2008
Location: Chicago, IL
Posts: 64
vb.net to c#
Code:
 {
    
    
     Outlook.Application objOutlk = new Outlook.Application();
     //Outlook
     const int olMailItem = 0;
     object objMail = new object();
     objMail = objOutlk.CreateItem(olMailItem);
     //Email item
     objMail.To = emaila.Text;
     objMail.cc = "";
     //Enter an address here To include a carbon copy; bcc is For blind carbon copy's
     //Set up Subject Line
     objMail.subject = "Quality Assurance Letter";
     //To add an attachment, use:
     //objMail.attachments.add("C:\MyAttachmentFile.txt")
     string msg;
     msg = "body test msg";
     objMail.body = msg;
     //Use this To display before sending, otherwise call objMail.Send to send without reviewing
     objMail.display();
     //Use this To display before sending, otherwise call objMail.Send to send without reviewing
     //Clean up
     objMail = null;
     objOutlk = null;
 }
http://labs.developerfusion.co.uk/co...to-csharp.aspx

although Refractor 2.0 does the same thing
__________________
David CodeGuru Article: Bound Controls are Evil-VB6

CodeGuru Reviewer
2006 Dell CSP
2006, 2007 & 2008 MVP Visual Basic
If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!
Reply With Quote
  #8  
Old 05-26-2008, 11:40 PM
haivijaykumar haivijaykumar is offline
Registered User
 
Join Date: May 2008
Posts: 2
Smile Issue with the OUTLOOK Code in C#

Hi,
Thanks for your Reply,i already used same code as below,

Outlook.Application objOutlk = new Outlook.Application();
//Outlook
const int olMailItem = 0;
object objMail = new object();
objMail = objOutlk.CreateItem(olMailItem);
//Email item
objMail.To = emaila.Text;
objMail.cc = "";
//Enter an address here To include a carbon copy; bcc is For blind carbon copy's
//Set up Subject Line
objMail.subject = "Quality Assurance Letter";
//To add an attachment, use:
//objMail.attachments.add("C:\MyAttachmentFile.txt")
string msg;
msg = "body test msg";
objMail.body = msg;
//Use this To display before sending, otherwise call objMail.Send to send without reviewing
objMail.display();
//Use this To display before sending, otherwise call objMail.Send to send without reviewing
//Clean up
objMail = null;
objOutlk = null;


but iam getting same errors as below,

objMail.To ==> objMail Dosen't Contain a Definition for "To" and "Cc" and all

is just contains "Equals", "GetHashCode","GetType","ToString".

Please Suggest me,but it is perfectly executed in VB.NET.

Thanks In Advance...

Vijay
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
outlook automation error in asp.net .... geeta .NET 4 02-20-2007 08:09 AM
Outlook 2003 + ASP.NET Peace2u ASP.NET 0 03-05-2006 09:02 AM
Opening a blank Infopath form from ASP.NET vikramjparekh ASP.NET 2 07-24-2005 10:21 PM
Free ASP.NET Web Matrix Design/Editor Tool Released ASPSmith Training dotnet.announcements 0 06-18-2002 03:39 AM
Opening other mailboxes in Outlook Gil Enterprise 0 02-28-2002 11:54 AM


All times are GMT -4. The time now is 07:59 AM.


Sponsored Links



Acceptable Use Policy

Internet.com
The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.