Click here to Skip to main content
15,908,254 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: How to access an image file located in shared folder Pin
Christian Graus26-Mar-08 11:41
protectorChristian Graus26-Mar-08 11:41 
AnswerRe: How to access an image file located in shared folder Pin
Abhijit Jana25-Mar-08 19:11
professionalAbhijit Jana25-Mar-08 19:11 
QuestionWeb Forms - Creating a DLL from cmd Pin
rakanishuu25-Mar-08 16:11
rakanishuu25-Mar-08 16:11 
GeneralRe: Web Forms - Creating a DLL from cmd Pin
Christian Graus25-Mar-08 16:18
protectorChristian Graus25-Mar-08 16:18 
Generaldisabled submit button Pin
Xarzu25-Mar-08 15:07
Xarzu25-Mar-08 15:07 
GeneralRe: disabled submit button Pin
Christian Graus25-Mar-08 15:55
protectorChristian Graus25-Mar-08 15:55 
QuestionRe: disabled submit button Pin
Jesse Squire25-Mar-08 15:56
Jesse Squire25-Mar-08 15:56 
QuestionUsing SMTP to send mail Pin
Mike Hankey25-Mar-08 11:23
mveMike Hankey25-Mar-08 11:23 
This should be simple but it just ain't working. I'm getting the following error whenever I submit it!

An existing connection was forcibly closed by the remote host

My web.config file contains the following;

<system.net>
<mailSettings>
<smtp deliveryMethod="Network">
<network host="smtp.bizmail.yahoo.com"
password="password"
port="465"
userName="username" />
</smtp>
</mailSettings>
</system.net>

And my code looks like this;

//Code starts here, we access the webconfig here
System.Configuration.Configuration myConfig = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration(HttpContext.Current.Request.ApplicationPath);
System.Net.Configuration.MailSettingsSectionGroup mySettings = ((System.Net.Configuration.MailSettingsSectionGroup)myConfig.GetSectionGroup("system.net/mailSettings"));

//Obtain credentials from web.config file under mailsettings node
System.Net.NetworkCredential myCredential = new System.Net.NetworkCredential(mySettings.Smtp.Network.UserName, mySettings.Smtp.Network.Password);

//Create an SMTP client here, can be found on account settings in outlook
System.Net.Mail.SmtpClient myClient = new System.Net.Mail.SmtpClient();

myClient.Host = mySettings.Smtp.Network.Host;
myClient.Port = mySettings.Smtp.Network.Port;
myClient.Credentials = myCredential;
myClient.EnableSsl = true;

//Build email message here:
System.Net.Mail.MailMessage myEmail = new System.Net.Mail.MailMessage();
myEmail.From = new System.Net.Mail.MailAddress(from);
myEmail.To.Add("mhankey@hq4thmarinescomm.com");
myEmail.Subject = "Feedback";
myEmail.IsBodyHtml = false;
myEmail.Body = body;

myClient.Send(myEmail);

myEmail.Dispose();

Much obliged,
Mike

GeneralRe: Using SMTP to send mail Pin
led mike25-Mar-08 11:36
led mike25-Mar-08 11:36 
GeneralRe: Using SMTP to send mail Pin
Mike Hankey25-Mar-08 11:46
mveMike Hankey25-Mar-08 11:46 
GeneralRe: Using SMTP to send mail Pin
Vasudevan Deepak Kumar25-Mar-08 19:17
Vasudevan Deepak Kumar25-Mar-08 19:17 
GeneralRe: Using SMTP to send mail Pin
Mike Hankey26-Mar-08 1:53
mveMike Hankey26-Mar-08 1:53 
GeneralQuirky Links and Form Pin
ffowler25-Mar-08 7:53
ffowler25-Mar-08 7:53 
GeneralRe: Quirky Links and Form Pin
pmarfleet25-Mar-08 9:39
pmarfleet25-Mar-08 9:39 
GeneralAuthenticating Web App Using AD Pin
dboy22125-Mar-08 7:40
dboy22125-Mar-08 7:40 
GeneralRe: Authenticating Web App Using AD Pin
Abhijit Jana25-Mar-08 19:05
professionalAbhijit Jana25-Mar-08 19:05 
Questionexporting gridview data into excel, i got this error. Help~ Pin
Dong Kim25-Mar-08 6:16
Dong Kim25-Mar-08 6:16 
GeneralRe: exporting gridview data into excel, i got this error. Help~ Pin
Elizma25-Mar-08 18:12
Elizma25-Mar-08 18:12 
QuestionRe: exporting gridview data into excel, i got this error. Help~ Pin
Dong Kim26-Mar-08 3:57
Dong Kim26-Mar-08 3:57 
QuestionHow to read xml data and make it as HTML table data? Pin
chakran25-Mar-08 4:14
chakran25-Mar-08 4:14 
AnswerRe: How to read xml data and make it as HTML table data? Pin
Mark J. Miller25-Mar-08 7:36
Mark J. Miller25-Mar-08 7:36 
QuestionResponse.WriteFile and Modal window Issue Pin
Saud AKhter25-Mar-08 3:56
Saud AKhter25-Mar-08 3:56 
GeneralCalling webservices asynchronously using java script Pin
Sql Exciter25-Mar-08 3:38
Sql Exciter25-Mar-08 3:38 
GeneralRe: Calling webservices asynchronously using java script Pin
Jesse Squire25-Mar-08 3:59
Jesse Squire25-Mar-08 3:59 
GeneralRe: Calling webservices asynchronously using java script Pin
Declan Bright25-Mar-08 4:01
Declan Bright25-Mar-08 4:01 

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.