Click here to Skip to main content
15,894,539 members
Home / Discussions / C#
   

C#

 
GeneralRe: Export data from Excel (xls file) to Sql data table by clicking on export button (c#) Pin
Eddy Vluggen19-Nov-14 2:58
professionalEddy Vluggen19-Nov-14 2:58 
GeneralRe: Export data from Excel (xls file) to Sql data table by clicking on export button (c#) Pin
Member 1113495419-Nov-14 23:30
Member 1113495419-Nov-14 23:30 
GeneralRe: Export data from Excel (xls file) to Sql data table by clicking on export button (c#) Pin
Eddy Vluggen20-Nov-14 5:11
professionalEddy Vluggen20-Nov-14 5:11 
GeneralRe: Export data from Excel (xls file) to Sql data table by clicking on export button (c#) Pin
Member 1113495421-Nov-14 22:28
Member 1113495421-Nov-14 22:28 
QuestionRe: Export data from Excel (xls file) to Sql data table by clicking on export button (c#) Pin
Eddy Vluggen22-Nov-14 3:57
professionalEddy Vluggen22-Nov-14 3:57 
GeneralRe: Export data from Excel (xls file) to Sql data table by clicking on export button (c#) Pin
PIEBALDconsult22-Nov-14 4:55
mvePIEBALDconsult22-Nov-14 4:55 
QuestionHow To Increase Width Excel Cell Size When I Export Excel File Pin
Nishant.Chauhan8013-Nov-14 22:11
Nishant.Chauhan8013-Nov-14 22:11 
AnswerRe: How To Increase Width Excel Cell Size When I Export Excel File Pin
Dave Kreskowiak14-Nov-14 2:15
mveDave Kreskowiak14-Nov-14 2:15 
QuestionHow to create Data recovery application using c#.net windows form Pin
Srikanth5913-Nov-14 18:27
Srikanth5913-Nov-14 18:27 
AnswerRe: How to create Data recovery application using c#.net windows form Pin
Dave Kreskowiak13-Nov-14 18:32
mveDave Kreskowiak13-Nov-14 18:32 
RantRe: How to create Data recovery application using c#.net windows form Pin
Richard Deeming14-Nov-14 2:15
mveRichard Deeming14-Nov-14 2:15 
QuestionPlug in for Gecko Browser Window to view a PDF? Pin
PDTUM13-Nov-14 7:54
PDTUM13-Nov-14 7:54 
QuestionHow to handle recording method in main form? Pin
Member 1110634813-Nov-14 4:37
Member 1110634813-Nov-14 4:37 
AnswerRe: How to handle recording method in main form? Pin
Eddy Vluggen13-Nov-14 5:39
professionalEddy Vluggen13-Nov-14 5:39 
GeneralRe: How to handle recording method in main form? Pin
BillWoodruff13-Nov-14 6:22
professionalBillWoodruff13-Nov-14 6:22 
GeneralRe: How to handle recording method in main form? Pin
Eddy Vluggen13-Nov-14 7:14
professionalEddy Vluggen13-Nov-14 7:14 
AnswerRe: How to handle recording method in main form? Pin
BillWoodruff13-Nov-14 6:21
professionalBillWoodruff13-Nov-14 6:21 
GeneralRe: How to handle recording method in main form? Pin
Member 1110634813-Nov-14 21:16
Member 1110634813-Nov-14 21:16 
AnswerRe: How to handle recording method in main form? Pin
Bernhard Hiller13-Nov-14 20:48
Bernhard Hiller13-Nov-14 20:48 
QuestionSending E mail using C# Pin
Fraol Gelana13-Nov-14 3:19
Fraol Gelana13-Nov-14 3:19 
could Someone help me, I tried to write a program to send an email, but it always fails!

C#
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Net;
using System.Net.Mail;

namespace emailC
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                using (MailMessage mail = new MailMessage())
                {
                    using (SmtpClient smtp = new SmtpClient("smtp.mail.yahoo.com", 587))
                    {
                        mail.From = new MailAddress("fgelana@yahoo.com");
                        mail.To.Add("fraolgela@gmail.com");
                        mail.Subject = "C# Email";
                        mail.Body = "This is for testing SMTP mail for yahoo using C#";
                        smtp.Credentials = new System.Net.NetworkCredential("name@yahoo.com", "password");
                        smtp.EnableSsl = false;
                        smtp.Send(mail);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
    }
}


It returns the following exception!
System.Net.Mail.SmtpException:Failure sending mail. --->
System.Net.WebException: The remote name could not be resolved

Thank You!
SuggestionRe: Sending E mail using C# Pin
Richard Deeming13-Nov-14 3:26
mveRichard Deeming13-Nov-14 3:26 
GeneralRe: Sending E mail using C# Pin
Fraol Gelana13-Nov-14 3:41
Fraol Gelana13-Nov-14 3:41 
GeneralRe: Sending E mail using C# Pin
Richard Deeming13-Nov-14 3:55
mveRichard Deeming13-Nov-14 3:55 
AnswerRe: Sending E mail using C# Pin
Richard Deeming13-Nov-14 3:29
mveRichard Deeming13-Nov-14 3:29 
AnswerRe: Sending E mail using C# Pin
BillWoodruff13-Nov-14 3:37
professionalBillWoodruff13-Nov-14 3:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.