Sent email from the program - c#

I already created the application in windows forms c# which ready to be use by another user in another computer, but i am aware there will be an error occurred when run my program (because i didn't have enough time to check everything), so i decided to let users find the bug and report to me through email.
I have a button "Report a Problem", but how do i when users click that button, it will open the Microsoft Outlook and automatically filled up the Received Email or "To" with my own email?

I would suggest:
Process.Start("mailto:your#emailaddress.com");
This will prompt Windows to create a new mail using the default email provider (which will most likely be Microsoft Outlook if it's installed).
To use this method, please add:
using System.Diagnostics;
to the top of your code file.

Use Diagnostics.Process.Start("mailto: senderEmail")
And it'll work only if you have outlook as your default email client

Namespace : using System.Diagnostics;
Process.Start("mailto:revanayyamca#gmail.com");

Related

Windows Authentication Pop up Issue in Selinum Automation

I am trying to write UI Automation for a Portal but while Authentication Chrome after entering User name a Pop up comes which can not be handled by selenium c#
I have tried using
https://username:password{siteurl}.com
But it didn't work. Also Auto IT nuget is not working. Any suggestions will be really helpful
PFB the screenshot for the same.
You can't try using a "robot" keyboard which just types in the keyboard. There is no need for the element to be inside the HTML page, as long as you know the prompt is focused:
Install the NuGet InputSimulator:
InputSimulator sim = new InputSimulator();
sim.Keyboard.TextEntry("User123");
sim.Keyboard.KeyPress(VirtualKeyCode.TAB);
sim.Keyboard.TextEntry("Password123");
sim.Keyboard.KeyPress(VirtualKeyCode.RETURN);
This way you just "hit" the keyboard. You code works regardless of the webpage.
If the popping prompt is not part of the HTML page, but a Windows alert, you can try using the keyboard:
new Actions(driver).SendKeys("User_Name").Perform();
new Actions(driver).SendKeys(Keys.Tab).Perform();
new Actions(driver).SendKeys("Password_here").Perform();
new Actions(driver).SendKeys(Keys.Tab).Perform();
new Actions(driver).SendKeys(Keys.Enter).Perform();
Basically you just type the user_name and password and hit the Enter key using Selenium.

process.start > mail to to open default mail error (winforms c#)

I'm new to WinForms and I want to open the default mail of the windows but I'm getting this error.
Does anyone know the reason?
Possibly the mailto url handler settings on your system are messed up. Take a look in HKCU\Software\Microsoft\Windows\Shell\Associations\URLAssociations\MAILTO\Userchoice or open the Default Apps control panel applet and ensure your email handler is set to a valid, installed program
As an aside, I've never seen [at] used in place of # in mailto URLs.. mailto:user#host.com?Subject=Hello world should work out fine:
(On the right is windows Mail)

How to share attachments from user to agent (Human handoff) using Bot?

i have bot made using c#. It has the feature of human off. We have integrated the solution provide by tompanna of human handoff where a agent can talk to single user at a time.Here the link of solution we used for human handoff https://github.com/tompaana/intermediator-bot-sample. Our bot is working fine and able to talk with agent with the help of this solution but major issue come when a user want to share image or any kind of attachments from user to agent or from agent to user. The bot show that image is send but user is not able to see it. Simpler case happen in the case of agent.
Image of agent while sending a attachment to user.
And also the image of user ,unable to see the image send by agent.
The sample which you are using for Human HandOff has not been updated over a year, so it gets difficult to be able to find solutions for supporting various features pertaining to the same. However, going through the sample issues, there has been a similar issue in which the sample does not support emojis, images or files to the receiving user. If a user sends any of the above mentioned features, the receiver will get a blank message as it supports only text messages.
Th tentative solution suggested by a user is to create a simple method extension to send image/file messages.You could go ahead and give it a try to see if it works for your case.
Hope this helps.
You need to edit the source code of the library to achieve what you are trying.
In this MessageRouter file , method RouteMessageIfSenderIsConnectedAsync , you can access message.Attachments , then pass it as a parameter to SendMessageAsync in line 432, then from SendMessageAsync in line 160 , you can pass it to CreateMessageActivity method and then in file ConnectorClientMessageBundle , you can access the attachment and attach it to messageActivity.

Sending an email from outlook in c#

I am following this guide and havent got very far
http://www.c-sharpcorner.com/UploadFile/casperboekhoudt/SendingEmailsThroughOutlook12052005000124AM/SendingEmailsThroughOutlook.aspx
I am getting stuck here
Now that we have the MAPI namespace,
we can log on using using:
.Logon(object Profile,
object Password, object ShowDialog,
object NewSession)
Profile: This is a string value that
indicates what MAPI profile to use for
logging on. Set this to null if using
the currently logged on user, or set
to an empty string ("") if you wish to
use the default Outlook Profile.
All i want to do from my programme is take the email address i already have in a variable and open up a new outlook email window with that email address in the too section.
Thanks very much.
This document on CodeProject shows how to open the default mail client.
http://www.codeproject.com/KB/dotnet/Default_mail_client.aspx
Check this list for common Outlook tasks.
I'm using the send attachments
It was quite easy to set up Outlook email capabilities to send reports in one of my apps following the one titled "HOW TO: Use the Microsoft Outlook Object Library to send a message that has attachments by using Visual C# .NET".
Good Luck

windows live mail mapi support

I am writing a c# .net application that needs to send email messages using MAPI. I am using the following library to achieve this http://www.codeproject.com/KB/IP/SendFileToNET.aspx
Here is an example how I use it.
MAPI mapi = new MAPI();
mapi.AddRecipientTo("test#test.com");
int returncode = mapi.SendMailPopup("subject", "message");
if(returncode==0)
{
MessageBox.Show("User sent message");
}
else if (returncode==1)
{
MessageBox.Show("User abort");
}
This piece of code opens a new message dialog on default mail program and should display if user decided to send or abort sending the email.
This code works fine when using Outlook meaning that it popups a new email dialog and returns the correct error code if user for example decides not to send the message by closing the message dialog.
The problem is that when using windows mail this does not work correctly. The send mail dialog opens correctly and the application pauses its execution on mapi.SendMailPopup until the mail dialog is closed. However no matter what the user does the mapi.SendMailPopup always return zero. If user would for example decide to close the message dialog without sending the message the mapi.SendMailPopup returns 0 when the correct response would be 1(user abort).
My question is should windows live mail have required MAPI-support for this, and if no can someone tell me some other free windows mail client that would offer the required MAPI-support
This is confusing-- that .NET solution is SMAPI, not MAPI. I'm not sure how reliable the return values from SMAPI are, especially since the return value is returned directly from your default MUA vendor's implementation of SMAPI, and there are at least a dozen of them out there. Since the browser doesn't use the return value, and they're the principal clients of SMAPI, I wouldn't rely on it.

Categories