Link to home
Start Free TrialLog in
Avatar of John Porter
John PorterFlag for United States of America

asked on

C# Console Application runs on Dev machine but will not install target machine

Hello Experts,

I found a C# application to send an e-mail using a reference to EASendMail35.dll at http://www.emailarchitect.net/easendmail/kb/csharp.aspx?cat=2

1 - I downloaded and installed the EASendMail dll on my dev machine and the target in the same location

2 - I followed the instructions on the web link above under the "C# - Send Email using Gmail Account over Explicit SSL (TLS) on 25 or 587 Port]" but changed to my gmail credentials.

3 - I compiled the APP with the EASendMail35.dll installed per 1 - above.

Some stats from the two machines:
 DEV machine -  is 64 bit windows 7, NEt Framework 4.5.1, Obviously has Visual Studio 2008 installed
 Target machine is 32 bit Windows 7., NEt Framework 4.5.1, Does not have Visual Studio 2008 installed

This app works great on my DEV machine but will not install on the Target machine.

Does anyone know what may be going on here ?

Thanks!



(The Code below is from the web example. I changed to my gmail credentials and it works fine on DEV machine only)


using System;
using System.Collections.Generic;
using System.Text;
using EASendMail; //add EASendMail namespace

namespace mysendemail
{
    class Program
    {
        static void Main(string[] args)
        {
            SmtpMail oMail = new SmtpMail("TryIt");
            SmtpClient oSmtp = new SmtpClient();
       
            // Your gmail email address
            oMail.From = "gmailid@gmail.com";
           
            // Set recipient email address
            oMail.To = "support@emailarchitect.net";
           
            // Set email subject
            oMail.Subject = "test email from gmail account";
           
            // Set email body
            oMail.TextBody = "this is a test email sent from c# project with gmail.";

            // Gmail SMTP server address
            SmtpServer oServer = new SmtpServer("smtp.gmail.com");
           
            // Set 25 port, if you want to use 587 port, please change 25 5o 587
            oServer.Port = 25;

            // detect SSL/TLS automatically
            oServer.ConnectType = SmtpConnectType.ConnectSSLAuto;

            // Gmail user authentication
            // For example: your email is "gmailid@gmail.com", then the user should be the same
            oServer.User = "gmailid@gmail.com";
            oServer.Password = "yourpassword";

            try
            {
                Console.WriteLine("start to send email over SSL ...");
                oSmtp.SendMail(oServer, oMail);
                Console.WriteLine("email was sent successfully!");
            }
            catch (Exception ep)
            {
                Console.WriteLine("failed to send email with the following error:");
                Console.WriteLine(ep.Message);
            }
        }
    }
}
ASKER CERTIFIED SOLUTION
Avatar of Miguel Oz
Miguel Oz
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
This app works great on my DEV machine but will not install on the Target machine.
What is the issue:  Does the app not work, or does it not install?
If your application is build such as to run only on 64 bit system, then there is possibility of throwing errors on 32 bit system.

You should build the application targeting both type of environments.