[Mono-aspnet-list] UpdatePanel and Systems.Net
TM
tranmanhdit at live.com
Tue Jun 15 06:37:02 EDT 2010
UpdatePanel does not work on linux. i use ubuntu 10.04. The monodevelop
version is 2.2. how do i solve this problem.
i use System.Net namespace to sendmail, when i deploy it on windows, it ok,
but on linux, it return a exception.
here is my code:
protected void btnSend_Click(object sender, EventArgs e)
{
SmtpClient smtp = new SmtpClient();
smtp.Host = "smtp.gmail.com";
smtp.Port = 587;
smtp.UseDefaultCredentials = true;
smtp.EnableSsl = true;
smtp.Credentials = new NetworkCredential("middlecowboy at gmail.com",
"oldtrafford");
MailAddress from = new MailAddress("middlecowboy at gmail.com", "Trần
Mạnh", System.Text.Encoding.Unicode);
MailAddress to = new MailAddress("tranmanhdit at live.com", "Trần
Mạnh", System.Text.Encoding.Unicode);
MailMessage message = new MailMessage(from, to);
message.Subject = txtTopic.Text;
StreamReader strReader = new
StreamReader(Server.MapPath("ContactUs/ContactUs.fmt"));
string content = strReader.ReadToEnd();
strReader.Close();
content = string.Format(content, txtName.Text, txtAddress.Text,
txtPhone.Text, txtFax.Text, txtEmail.Text, txtTopic.Text, txtContent.Text);
message.Body = content;
message.IsBodyHtml = true;
int tried = 1;
do
{
try
{
smtp.Send(message);
lbErrorMessage.Text = "Message has been sent!";
lbErrorMessage.Visible = true;
txtName.Text = string.Empty;
txtAddress.Text = string.Empty;
txtFax.Text = string.Empty;
txtEmail.Text = string.Empty;
txtTopic.Text = string.Empty;
txtContent.Text = string.Empty;
txtPhone.Text = string.Empty;
break;
}
catch (Exception ex)
{
if (tried > 5)
{
lbErrorMessage.Text = ex.Message;
lbErrorMessage.Visible = true;
break;
}
}
++tried;
}
while (true);
}
Thanks
--
View this message in context: http://mono.1490590.n4.nabble.com/UpdatePanel-and-Systems-Net-tp2255680p2255680.html
Sent from the Mono - ASP.NET mailing list archive at Nabble.com.
More information about the Mono-aspnet-list
mailing list