Click here to Skip to main content
15,886,919 members
Home / Discussions / C#
   

C#

 
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 
GeneralRe: Sending E mail using C# Pin
jschell13-Nov-14 11:27
jschell13-Nov-14 11:27 
AnswerRe: Sending E mail using C# Pin
Marco Bertschi13-Nov-14 23:01
protectorMarco Bertschi13-Nov-14 23:01 
QuestionHow To Create Data Recovery in C#.net Pin
Srikanth5913-Nov-14 1:51
Srikanth5913-Nov-14 1:51 
AnswerRe: How To Create Data Recovery in C#.net Pin
Dave Kreskowiak13-Nov-14 2:08
mveDave Kreskowiak13-Nov-14 2:08 
QuestionPDFSHARP - table page break Pin
Mol4ok12-Nov-14 22:19
Mol4ok12-Nov-14 22:19 
AnswerRe: PDFSHARP - table page break Pin
Mol4ok16-Nov-14 15:57
Mol4ok16-Nov-14 15:57 
GeneralRe: PDFSHARP - table page break Pin
Mycroft Holmes16-Nov-14 18:32
professionalMycroft Holmes16-Nov-14 18:32 
GeneralRe: PDFSHARP - table page break Pin
Mol4ok16-Nov-14 21:03
Mol4ok16-Nov-14 21:03 
QuestionCannot access a disposed object. Object name : System.Net.Mail.MailMessage Pin
Jassim Rahma12-Nov-14 20:35
Jassim Rahma12-Nov-14 20:35 
AnswerRe: Cannot access a disposed object. Object name : System.Net.Mail.MailMessage Pin
BillWoodruff12-Nov-14 21:04
professionalBillWoodruff12-Nov-14 21:04 
AnswerRe: Cannot access a disposed object. Object name : System.Net.Mail.MailMessage PinPopular
Bernhard Hiller12-Nov-14 21:10
Bernhard Hiller12-Nov-14 21:10 
AnswerRe: Cannot access a disposed object. Object name : System.Net.Mail.MailMessage Pin
Marco Bertschi13-Nov-14 23:05
protectorMarco Bertschi13-Nov-14 23:05 

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.