Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / October 2007

Tip: Looking for answers? Try searching our database.

Email Not Set

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Robert E. Flaherty - 03 Oct 2007 00:41 GMT
Using .NET 2.0 in Visual Studio 2005, I am attempting to send an email.  I am
utilizing Yahoo as the SMTP provider.  I am able to send emails using the
setup instructions below using Outlook.  When I attempt to send an email
using C#, I get a message that no email was sent.

I have included the section of C# that covers this issue.

Configure your POP email program.

Sign-in Information
Server Settings
username - info@MyCompany.com
password - myPassword

Incoming Mail (POP3)
pop.bizmail.yahoo.com
Use SSL, port: 995

Outgoing Mail (SMTP)
smtp.bizmail.yahoo.com
Use SSL, port: 465; authentication required
As soon as you set up your account, you can start sending and receiving
messages from your new email address!

       public static void SendEmail()
       {
           /* create the email message */
           MailMessage message
               = new MailMessage("info@MyCompany.com",
               "ref@yourCompany.Com", "subject of the Message ",
               "body fo the message ");
           /* create SMTP Client and add credentials */
           SmtpClient smtpClient = new SmtpClient();
           smtpClient.Port = 465;
           smtpClient.EnableSsl = true;
           smtpClient.UseDefaultCredentials = false;
           smtpClient.Credentials
               = new NetworkCredential("info@MyCompany.com",
               "myPassword");
           smtpClient.DeliveryMethod = SmtpDeliveryMethod.Network;
           smtpClient.Host = "smtp.bizmail.yahoo.com";
           smtpClient.PickupDirectoryLocation = "C:\\Temp";
           
           /*Send the message */
           try
           {
               smtpClient.Send(message);
           }
           catch (System.Net.Mail.SmtpException e)
           {
               MessageBox.Show(e.Message);
           }
           catch (Exception e)
           {
               MessageBox.Show(e.Message);
           }

       }
Som Nath Shukla - 03 Oct 2007 04:17 GMT
for detail see http://sns-dotnet.spaces.live.com/ 

> Using .NET 2.0 in Visual Studio 2005, I am attempting to send an email.  I am
> utilizing Yahoo as the SMTP provider.  I am able to send emails using the
[quoted text clipped - 54 lines]
>
>         }
Robert E. Flaherty - 03 Oct 2007 16:59 GMT
After reviewing the sample you provided, I changed the following code:

MailMessage message
= new MailMessage("info@MyCompany.com",
"ref@yourCompany.Com", "subject of the Message ",
"body fo the message ");

To:
           MailMessage message = new MailMessage();
           message.From = new MailAddress  ("info@dobbsstanfordsales.com",
"Dobbs-Stanford Sales");
           message.To.Add("ref@dobbsstanford.com");
           message.Subject="subject of the Message";
           message.Body="body of the message";

I am getting the same results, "Failure to Send".

> for detail see http://sns-dotnet.spaces.live.com/ 
>
[quoted text clipped - 56 lines]
> >
> >         }
sloan - 03 Oct 2007 19:06 GMT
http://sholliday.spaces.live.com/Blog/cns!A68482B9628A842A!138.entry

Take a peek at my blog entry, and get teh downloadable example.

I have SSL and alternate port information/ability there.

My sample uses gmail/google mail, but would be a quick change to try yahoo
stuff.

> Using .NET 2.0 in Visual Studio 2005, I am attempting to send an email.  I
> am
[quoted text clipped - 55 lines]
>
>        }

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.