我现在想写一个通用的函数,通过参数得到邮件的信息,然后启动outlook界面自动填入内容。
我在windows程序里面,可以通过process.start("mailto:*****")实现,但是在web里面怎么实现?
虽然我知道通过<a href="mailto:****>mail</a>就可以了,但是我希望通过后台的程序实现而不是前台的超级链接。

解决方案 »

  1.   

    Imports System.net
    Imports System.Net.Mail
    Imports System.Net.Configuration
    Imports System.Configuration
    Imports System.Configuration.ConfigurationManager
    Imports System.Web.Configuration<system.net>
    <mailSettings>
    <smtp deliveryMethod="Network" from="">
    <network host="smtp.263xmail.com" userName="" password=""/>
     </smtp>
      </mailSettings>
       </system.net>subject,body 是asp:textbox
    mailto 是 appSettings中的配置
     Dim ToAddress As String = System.Configuration.ConfigurationManager.AppSettings("mailto").ToString
    using As New MailMessage(NetSectionGroup.GetSectionGroup(WebConfigurationManager.OpenWebConfiguration("~/web.config")).MailSettings.Smtp().From, ToAddress, subject.Text, body.Text)
         
     Dim smtp As New SmtpClient
            smtp.Send(mail)  end using
      

  2.   

    ??不是很明白你的意思。
    需要后台实现什么?
    如果用后台发邮件的话直接可以用微软的SMTP类去发送邮件啊,不一定要打开Outlook才能发邮件的。
      

  3.   

    我知道通过mailmessage的方法,现在是希望能够显示出outlook界面来,然后用户可以修改一些内容。我知道通过超级链接可以,但是我希望在server端处理。就是响应了server端asp.net控件的方法,在cs文件里面实现。
      

  4.   

    你变通个方式啦,像比如:
    private void page_load(...)
    {
      button1.Attributes.Add("onclick", "window.open('mailto:[email protected]')");
    }
    又或者RegisterClientScriptBlock(..)
      

  5.   

    用mailto: 的形式,不能加入附件,mailto 基本没什么用的