Solved

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

Posted on 2014-09-10
3
322 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 36

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

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Groupbox Control ? 2 27
I need help adding validation to my MVC.Net view 6 21
Installing .NET 3.5 on Windows Server 2012 1 58
Set arraylist as datatable 2 6
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display

763 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