TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Manish Solanki
NA
77
25.5k
send mail in Microsoft Office Outlook
Sep 23 2015 3:38 AM
Hello Everyone,
I have to send mail from one static id to microsoft office outlook.i will send code of my .please help me
sending id="
[email protected]
";
to:"
[email protected]
";
public Outlook.Account GetAccountForEmailAddress(Outlook.Application application, string smtpAddress)
{
// Loop over the Accounts collection of the current Outlook session.
Outlook.Accounts accounts = application.Session.Accounts;
foreach (Outlook.Account account in accounts)
{
// When the e-mail address matches, return the account.
if (account.SmtpAddress == "
[email protected]
")
{
return account;
}
}
throw new System.Exception(string.Format("No Account with SmtpAddress: {0} exists!", smtpAddress));
}
Outlook.Application oApp = new Outlook.Application();
Outlook._NameSpace oNamespace;
Outlook.MAPIFolder oOutbox;
oNamespace = oApp.GetNamespace("MAPI");
oNamespace.Logon(null, null, true, true);
Outlook.MailItem oMsg = (Outlook.MailItem)oApp.CreateItem(Outlook.OlItemType.olMailItem);
oMsg.Subject = "Sign In......!";
oMsg.To = "
[email protected]
";
Outlook.Account account = GetAccountForEmailAddress(oApp,"
[email protected]
");
oMsg.SendUsingAccount = account
oMsg.Send();
oMsg = null;
oApp = null;
i want to send mail from
[email protected]
this id.
to anyone
i hope you will send me help in code
Reply
Answers (
16
)
Crystal Reports Printing by Loop
cannot convert from 'System.Enum' to 'byte'