Solved

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

Posted on 2014-09-10
3
316 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
ID: 40315890
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 75

Expert Comment

by:käµfm³d 👽
ID: 40316068
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
ID: 40316080
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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

777 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