|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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! |
|
#3
|
|||
|
|||
|
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 |
|
#4
|
|||
|
|||
|
__________________
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! |
|
#5
|
|||
|
|||
|
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 |
|
#6
|
|||
|
|||
|
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 |
|
#7
|
|||
|
|||
|
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;
}
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!
|
|
#8
|
|||
|
|||
|
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 |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
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 |