在Silverlight中的电子邮件概念. [英] Email concept in silverlight.

查看:83
本文介绍了在Silverlight中的电子邮件概念.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我是Silverlight的新手.

我没有获得实现此概念的正确代码.

我在xaml页面中有四个文本框和一个按名称提交的按钮,一个来自文本框,第二个是文本框,第三个是主题文本框,最后一个是主体文本框.

当用户单击提交"按钮时,邮件应转到特定的电子邮件地址,如果我们已将其从特定"地址分配到收件人"文本框中,则应将其分配给从"文本框中的邮件.

我想知道实现此概念的不同方法.

谢谢,
swapna.

Hi,
I am new to silverlight.

I am not getting the correct code to implement this concept.

I have four textboxes and one button by name submit in my xaml page,one is from textbox,2nd is to textbox,3rd is subject textbox and last one is body textbox.

When user clicks on submit button mail should go to the particular email address were we have assigned it in the to textbox from the particular address were we have assigned it in the from textbox.

I want to know different methods to implement this concept.

Thanks,
swapna.

推荐答案

如果您用Google搜索"C#发送邮件",您将获得708,000条结果.这是其中一个的代码段.

If you google "C# send mail", you''ll get 708 thousand results back. Here''s a code snippet from one of them.

try
{
    MailMessage mail = new MailMessage();
    SmtpClient SmtpServer = new SmtpClient("smtp.yourdomain.com");

    mail.From = new MailAddress("your_email_address@yourdomain.com");
    mail.To.Add("to_address@domain.com");
    mail.Subject = "Test Mail";
    mail.Body = "This is for testing SMTP mail from GMAIL";

    SmtpServer.Credentials = new System.Net.NetworkCredential("username", "password");
    SmtpServer.Port = 587; // only do this if you need to
    SmtpServer.EnableSsl = true; // only do this if you need to

    SmtpServer.Send(mail);
}
catch (Exception ex)
{
    // handle exception
}


我认为Silverlight不支持SmtpClient .您可以使用Web服务进行实际的电子邮件发送,然后您的Silverlight应用程序可以通过向Web服务发送所需的信息来发送电子邮件.

请参阅有关同一主题的此论坛主题:

http://forums.silverlight.net/forums/t/12762.aspx [ ^ ]
I don''t think SmtpClient is supported in Silverlight. You can use a webservice to do the actual emailing, and your Silverlight app can then send email through the webservice by sending it the required info.

See this forum thread on the same topic:

http://forums.silverlight.net/forums/t/12762.aspx[^]


[ ^ ]当然可以帮助您.
This[^] surely should help you out.


这篇关于在Silverlight中的电子邮件概念.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆