|
|
Weather in Tulsa, OK (74133)

|
Current Conditions:
|
 |
79°F
Fair
|
|
Wind: CALM calm mph
|
|
SAT 9/4

L:55
| SUN 9/5
 H:89 L:64
| MON 9/6
 H:93 L:69
| TUE 9/7
 H:87 L:68
|
|

Last Update: 5:05:40 PM
|
weather.com
|
|
Services
|
|
|
|
|
Welcome to Terranet Technologies forum. This is a private Web Service so it
will require you to create a seperate account other than your Terranet account.
Please use your existing Terranet user name. It will only require your email and a password to join. |
|
|
|
|
|
|
|
|
ASP.Net 2.0 Email
Posted: 14 Mar 07 7:11 AM
|
| I am trying to send an email using Visual Studios 2005. Any help would be appreciated. |
|
|
|
Re: ASP.Net 2.0 Email
Posted: 14 Mar 07 8:27 AM
|
This works for me.
under configuration in the web.config file enter: (under host be sure to enter you mail server ip address)
<system.net > <mailSettings> <smtp from="support@terranettech.net"> <network host="0.0.0.0" password="" userName=""/> </smtp> </mailSettings> </system.net>
Code:
using System.Net.Mail;
public static void SendOutEmail(string to, string from, string sub, string body) { SmtpClient smtpClient = new SmtpClient(); MailMessage message = new MailMessage();
try { message.From = new MailAddress(from); message.To.Add(new MailAddress(to)); message.Subject = sub; message.Body = body; //message.Attachments.Add(new Attachment(attch));
smtpClient.Send(message); } catch (Exception ex) { throw new System.Exception(ex.Message); } }
|
|
|
|
Re: ASP.Net 2.0 Email
Posted: 14 Mar 07 8:41 AM
|
Thank you I am uncertain about where to place and call my email server address? |
|
|
|
Re: ASP.Net 2.0 Email
Posted: 15 Mar 07 7:01 AM
|
Under the web.config files in the above instuctions where you see 0.0.0.0 here put your exchanges servers ip address. |
|
|
|
|
|