Advertisement
Advertisement
| 05.09.2008 at 01:01PM PDT, ID: 23390683 | Points: 125 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: |
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Net.Mail;
namespace GALawyer
{
public class SendEmail
{
public static void SimpleEmail(string to, string from, string subject, string message)
{
try
{
MailMessage msg = new MailMessage();
msg.To.Add(to);
msg.From = new MailAddress (from);
msg.Subject = subject;
msg.Body = message;
SmtpClient mySmtp = new SmtpClient("HOST");
mySmtp.Send(msg);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
}
}
|
| Microsoft |
| Apple |
| Internet |
| Gamers |
| Digital Living |
| Virus & Spyware |
| Hardware |
| Software |
| ITPro |
| Developer |
| Storage |
| OS |
| Database |
| Security |
| Programming |
| Web Development |
| Networking |
| Other |
| Community Support |
| 05.09.2008 at 01:38PM PDT, ID: 21536262 |
| 05.10.2008 at 09:56PM PDT, ID: 21541516 |
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: |
System.Net.Mail.MailMessage mm = new System.Net.Mail.MailMessage();
mm.From = new MailAddress("blah@blah.com");
mm.IsBodyHtml = true;
mm.Priority = System.Net.Mail.MailPriority.High;
mm.Subject = String.Format(@"{0}", Subject);
mm.Body = String.Format(@"{0}", MessageBody);
try
{
SmtpClient client = new SmtpClient("relay-hosting.secureserver.net");
client.Credentials = new NetworkCredential("your_login", "your_password");
client.Port = 25;
client.EnableSsl = false;
client.Send(mm);
}
catch (Exception ex)
{
string msg = ex.Message;
while (ex.InnerException != null)
{
ex = ex.InnerException;
msg += "||" + ex.Message;
}
}
|
| 05.13.2008 at 05:56AM PDT, ID: 21554525 |