-
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
-
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!
-
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
-
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!
-
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
-
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
-
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! 
-
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
Similar Threads
-
Replies: 4
Last Post: 02-20-2007, 09:09 AM
-
By Peace2u in forum ASP.NET
Replies: 0
Last Post: 03-05-2006, 10:02 AM
-
By vikramjparekh in forum ASP.NET
Replies: 2
Last Post: 07-24-2005, 10:21 PM
-
By ASPSmith Training in forum dotnet.announcements
Replies: 0
Last Post: 06-18-2002, 03:39 AM
-
By Gil in forum Enterprise
Replies: 0
Last Post: 02-28-2002, 12:54 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|