c# - unable to open the default mail client -
I am using the following code to open the default mail client
using Tax (Process Mail Process = New Process ()) {ProcessStartInfo processInfo = new ProcessStartInfo (); ProcessInfo.FileName = string.Format (CultureInfo.InvariantCulture, "mailto: {0}? Subject = {1} & body = {2}", sendToAddress.Address, subject, message); ProcessInfo.UseShellExecute = True; ProcessInfo.WindowStyle = Process WindowStyle.Normal; MailProcess.StartInfo = processInfo; Process.Start (processInfo); } It starts the process but does not show mail to the client. In reality, when I am using only local host, this mail does not open to the client, although this process begins
When I am using Localhost: It works.
Can I solve anyway?
According to you, it is necessary to ensure that you change the name of the file to URL encode. It can not contain spaces or other special characters, which are not available in the URL.
Do you suspect that your subject and body includes at least spaces or Newline you can use for this task.
Comments
Post a Comment