stockpicker
04-24-2011, 03:05 AM
I am not able to use the mail class to send mail to or from my discountasp mail account. I am using c#.
This is what I am trying:
MailMessage mail = new MailMessage();
mail.IsBodyHtml = true;
//set the addresses
mail.From = new MailAddress(strUserEmail);
mail.To.Add(new MailAddress("Support@StockPickerMax.com"));
//set the content
mail.Subject = "Error Notice - StockPickerMax";
mail.Body = strBody;
//send the message
if (strConnection.Contains("StockProSQL")) // Local server
{
// do not send mail;
}
else // Remote server
{
SmtpClient smtp = new SmtpClient("smtp.stockpickermax.com", 8889);
smtp.Send(mail);
}
This is the error:
No connection could be made because the target machine actively refused it 64.79.170.142:8889
Description: An unhandled exception occurred during the execution of the current web request.
Exception Details: System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 64.79.170.142:8889
Source Error:
Line 182: SmtpClient smtp = new SmtpClient("smtp.stockpickermax.com", 8889);
Line 183:
Line 184: smtp.Send(mail);
Line 185: }
Line 186: conStockSelect.Close();
I received the following from discountasp support:
You will either have to use "localhost" which doesn't require authentication when sending, or you'll have to use your SMTP server (smtp.stockpickermax.com) using a valid email address (ie. User@stockpickermax.com) with the password to the account.
------
"localhost" does not work for me.
I need toknow how to code the following:
or you'll have to use your SMTP server (smtp.stockpickermax.com) using a valid email address (ie. User@stockpickermax.com) with the password to the account.
Thanks,
This is what I am trying:
MailMessage mail = new MailMessage();
mail.IsBodyHtml = true;
//set the addresses
mail.From = new MailAddress(strUserEmail);
mail.To.Add(new MailAddress("Support@StockPickerMax.com"));
//set the content
mail.Subject = "Error Notice - StockPickerMax";
mail.Body = strBody;
//send the message
if (strConnection.Contains("StockProSQL")) // Local server
{
// do not send mail;
}
else // Remote server
{
SmtpClient smtp = new SmtpClient("smtp.stockpickermax.com", 8889);
smtp.Send(mail);
}
This is the error:
No connection could be made because the target machine actively refused it 64.79.170.142:8889
Description: An unhandled exception occurred during the execution of the current web request.
Exception Details: System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 64.79.170.142:8889
Source Error:
Line 182: SmtpClient smtp = new SmtpClient("smtp.stockpickermax.com", 8889);
Line 183:
Line 184: smtp.Send(mail);
Line 185: }
Line 186: conStockSelect.Close();
I received the following from discountasp support:
You will either have to use "localhost" which doesn't require authentication when sending, or you'll have to use your SMTP server (smtp.stockpickermax.com) using a valid email address (ie. User@stockpickermax.com) with the password to the account.
------
"localhost" does not work for me.
I need toknow how to code the following:
or you'll have to use your SMTP server (smtp.stockpickermax.com) using a valid email address (ie. User@stockpickermax.com) with the password to the account.
Thanks,