如何在带有附件的asp.net中发送电子邮件 [英] how to send email in asp.net with attachment

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

问题描述

我想在asp.net中发送电子邮件.我尝试了我在
中获得的代码 url 在ASP.Net 2.0中发送电子邮件-反馈表格 [

hi i want to send email in asp.net .i have tryied ur code which i got in
the url Send Email in ASP.Net 2.0 - Feed back Form[^]

but it is not working.
i tryied to find a error by writing code as ex.InnerException.Message it was Unable to connect to the remote server

推荐答案

查看此链接

http://tinyurl.com/2daaay8 [ ^ ]

看看有多少,只看那些结果即可!
Look at this link

http://tinyurl.com/2daaay8[^]

Look how many there are, just look at those results!


快速方法:

您可能需要将服务器详细信息放在:
Quick method:

You may need to put the server details in:
<configuration>
  <!-- Add the email settings to the <system.net> element -->
  <system.net>
    <mailSettings>
      <smtp>
        <network

             host="relayServerHostname"

             port="portNumber"

             userName="username"

             password="password" />
      </smtp>
    </mailSettings>
  </system.net>
  <system.web>
    ...
  </system.web>
</configuration>





然后创建表单:





And then Create the form:

<table border="0">
    <tr>
        <td><b>Your Email:</b></td>
        <td><asp:TextBox runat="server" ID="UsersEmail" Columns="30"></asp:TextBox></td>
    </tr>
    <tr>
        <td><b>Subject:</b></td>
        <td><asp:TextBox runat="server" ID="Subject" Columns="30"></asp:TextBox></td>
    </tr>
    <tr>
        <td colspan="2">
            <b>Body:</b><br />
            <asp:TextBox runat="server" ID="Body" TextMode="MultiLine" Columns="55" Rows="10"></asp:TextBox>
        </td>
    </tr>
    <tr>
        <td colspan="2" align="center">
            <asp:Button runat="server" ID="SendEmail" Text="Send Feedback" />
        </td>
    </tr>
</table>


这篇关于如何在带有附件的asp.net中发送电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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