Solved

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

Posted on 2014-09-10
3
314 Views
Last Modified: 2014-10-07
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);
            }
        }
    }
}
0
Comment
Question by:Saxitalis
3 Comments
 
LVL 35

Accepted Solution

by:
Miguel Oz earned 500 total points
Comment Utility
Two questions:
Q1. Did you build your app as a 32-bit application? (X-86 instead of the default Any CPU) and you are using the correct DLL run-time build?
Q2. Did you have the same .NET version installed (Target machine)
Q3. Is the app run as admin in the Target machine?
If the answer is YES to all of the questions then you need to check that your exe includes the component dll. (Compare with your debug/release content folder)
0
 
LVL 74

Expert Comment

by:käµfm³d 👽
Comment Utility
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?
0
 
LVL 16

Expert Comment

by:Vikram Singh Saini
Comment Utility
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.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now