C# Win. form - Outlook not accepting BCC parameter - c#

i am creating a URL link to directly open Outlook's compose email page where all the email will be populated as soon as the page appears but the problem is when i enter the below URL
https://snt149.mail.live.com/?page=Compose&to=test1#gmail.com&cc=test2#gmail.com&BCC=test3#gmail.com
all the fields get filled up except the BCC one. Can anyone tell me where i am going wrong? Any piece of suggestion will be appreciated.

this works fine with Outlook as Email application. In my case it's tested with 2010 Outlook version. You are hard coded to web email which does not make so much sense, does it??
abcd#gmail.com
edit:
I cannot include a working test link here, probably due to HTML restrictions of SO

Related

Click "Send" button of G-Mail programmatically

I am creating an Email Sending Software. So far i am able to open chrome and fill the details of the email (subject,body,attachments and all) but i wanted to know is there any way i can click Send button of G-Mail programmatically too?
Code for filling details in chrome
Process ps = Process.Start("chrome.exe", "https://mail.google.com/mail/u/0/?view=cm&fs=1&tf=1&to=a#gmail.com&bcc=b#gmail.com);
Note I haven't used SmtpClient to send email because it was not fulfilling my customized requirement (sorry cannot disclose the reason).
The way you want this, is not possible. Process.Start opens a new Process. In this case it opens Google Chrome, with the URL you sent with it. This URL contains a querystring containing the subject and the body of the email. This is possible, because Google reads this on the server-side, and puts it in the right fields. There is no way to enter the send button though. This is a POST action, which can not be triggered by a URL.
C# form, does have a WebBrowser class. From here you can access buttons and click them, but I don't think Google will allow this, and most likely send you a captcha. (That is, if you manage to login in the first place.)
I can't help with the simulated button press you're looking for, but I can suggest that you rather try to use the Gmail API to do what you're trying to do:
https://developers.google.com/gmail/api/?hl=en
This would be a more reliable and stable way to send gmail programmatically, and you still don't have to use the smtp object directly.
You should probably use Selenium (WebDriver). It allows you to control browser from c# code, navigates pages, traversing DOM etc..

Outlook adds `<span style='color:blue'>` to HTML links

I am creating an Outlook add-in using C# that searches for a link in an HTML (new) email body signature when a user clicks on Send button in Outlook email. I am hooking into Application_ItemSend event. What's odd is that on my machine running XP/Outlook 2007 and in another Win7/Outlook 2007 machine, I am able to search for the link in the signature with no problems. But on some other Win7/Outlook 2007 machine, I am not able to search for the link because an additional span element is being inserted by Outlook.
For example, I am searching for Link in an HTML (new) email body. The link above is being inserted by a default signature so I am expecting to find it all the time. On some machines I am able to, on some machines I am not able to because the link appears like this:
<span style='color:blue'>Link</span>
I've rolled out a standard signature html file so the signatures for all machines are the same, but the issue still persists. I am still in the process of comparing the font/theme settings, but so far have seen no difference.
Does anyone have an idea on what's happening here?
Thanks.

Link to specific email in Exchange 2010 (EWS)

We have a web application that links to an exchange account and shows a list of all emails relating to that specific customer. When you click on an email in the list then that specific email opens in a new window in OWA.
We have just been upgraded to Exchange 2010 and I was pleased to find that all this code needed to be rewritten as WebDav has been deprecated! I've got everything working so far except opening the email. This is an example of the URL I get when opening one manually:
https://owa.example.com/owa/?ae=Item&a=Open&t=IPM.Note&id=RgAAAADmf6EZfqbORr1%2fiveFFYyBBwDf6W1FdO8tR59JIuH4tblWAAABcKsWAAAT7QzqtNGiR6C1Ogbnj0IjAAAAA050AAAA&pspid=_1328545178425_761458089
The problem is that I don't know how to get the last parameter (pspid). Does anyone know what this is? I'm starting to think it might be a security token for the session as opposed to part of the email. Does anyone know know the best way to generate a link like this?
Thanks
It took about a day to find the answer so I hope this helps someone. I needed to convert to the OwaId.
//Get the OWA Id
public String GetOutlookOwaId(EmailMessage message, ExchangeService ser)
{
AlternateId ewsId = new AlternateId(IdFormat.EwsId, message.Id.ToString(), "person#example.com");
AlternateIdBase owaId = ser.ConvertId(ewsId, IdFormat.OwaId);
return ((AlternateId)owaId).UniqueId;
}

How do I use the Windows Mail Protocols? (C#?)

Well, for my program(s) I'd like to let the user send me an e-mail with any errors. Instead of relying on a forsaken SMTP server, I decided to let the user use his very own e-mail client to send an e-mail to a specified address.
So what I need is:
A sender (should not be changeable) (example: mysupportemail#gmail.com)
An attached file (should not be changeable) (example: "C:\a file.log")
(Optional) A body (changeable)
I hope it is possible!
You can use the mailto command for this. See http://msdn.microsoft.com/en-us/library/aa767737(VS.85).aspx for more information. Some mail clients support attachments on this. See the comments of the MSDN page for some information on this.
The mailto protocol has limitations, such as not being able to specify an attachment (some mail clients support it, but it's not in the official protocol). Your best option is probably to use the MAPISendMail function to let MAPI do the hard work. See this article for details:
Sending files via the default e-mail client
I used this technique in the past, it seems to work perfectly.
Using mailto directly from you application cause potential problems. If you have specified mail account for receive e-mails you can be sure, that someone will use it somehow to sent you spam or thousands unwanted emails. In our company we struggled with this problem many times - at last, we decided to allow our customers to report problems in any other way - web page form.
Now, when customer click 'report problem' this option displays a form for reporting bugs in default web browser. Opened link include some additional information which causing partial fill of the form opened by customer. Now, we have an intermediate layer and absolute control on server side who report problem (ip) and we can limit reporting for specified users. Next advantage of these solution is that you can forward emails to different departments depending on what form fields are marked/filled with.
Well, I have found the perfect solution!
For those who want to see it...
http://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/a75533eb-131b-4ff3-a3b2-b6df87c25cc8
http://www.eggheadcafe.com/community/aspnet/2/10019665/email-through-gmail-in-c.aspx

how to add textbox in the mail body?

I am using asp.net and C#.
I have a requirement in which i need to add one textbox in the mail body.
After the user registration, i need to send a welcome mail. i tried to add the input tag in the mail body, but i am able to see on [ ](two square brackets).
Can anyone tell me how to do this?
I wouldn't do this. Like other people said: this is impossible at best.
Think of the vast variety of email clients nowadays and the Spam community actively trying to break hell loose on your computer each day. Basic HTML is allowed in email, images (if not embedded) are blocked, Javascript is not allowed.
For your own sake, try to redefine this requirement to be input on a webpage with a link in the welcome email. If you continue to find a solution to this, you'll end up pulling your hair out.
Guess this is impossible.
AFAIK, HTML email is rendered at the client using a parser, not a fully functional web client.
So I don't know email clients which will allow you to do this.
More information about HTML e-mails could be found here.

Categories

Resources