?
Solved

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

Posted on 2014-09-10
3
Medium Priority
?
336 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 2000 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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

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