Send Mail

R

Retf

Hi All,
I need send e-mail through the form.
I tried this:

---------------------------------------------------
DateTime dt = DateTime.Now;

String sMsg = "<p><font face='Verdana' size='1'>Trinity Systems - Comprar -
Private Label Control - " + dt.Day + "/" + dt.Month + "/" + dt.Year +
"</font></p>" + "<hr color='#C0C0C0' align='left' size='3'>" + "<br> Nome:"
+ TextBoxNome.Text + "<br>E-mail:" + TextBoxEmail.Text;

SmtpMail.SmtpServer = "SMTP.TRINITYSYSTEM.NET.NETSOLMAIL.NET";

MailMessage mail = new MailMessage();

mail.BodyFormat = MailFormat.Html;

mail.To = "(e-mail address removed)";

mail.From = TextBoxEmail.Text.Trim();

mail.Subject = "Trinity Systems - Comprar - Private Label Control";

mail.Body = sMsg;



try

{

SmtpMail.Send(mail);

}

catch(System.Exception ex)

{

Response.Write(ex.Message);

Response.Redirect("http://www.trinitysystems.net/error/default.aspx?id=TS001&msg="
+ ex.Message);

}

mail = null;

Response.Redirect("success.htm");

---------------------------------------------------

But I receive this message of server: --> Could not access 'CDO.Message'
object

How to correct this?

Have other way to send mail?


-----------------
ASP.NET 1.0
Windows XP SP2
VisualStudio 2003



Thanks
 
I

Ian Frawley

I seemed to get this error all the time when using MailMessage it seemed
that the 'Collaborated Data Objects' or whatever it stands for was finiky so
I binned it for a 3rd party Mail library. DevBizmail I think its called but
the full license is shockingly expensive. There are some good 3rd party
solutions. I hated having to bin it because I hate being beaten but the
pressures of delivering solutions on time got in the way. DevBizmail has a
freeware but it puts a funky little signature at the bottom of the email.

Ian
 
Q

qwerty

I normally get this error message when my email couldn't be deliver
due to incorrect smtp server or email address.
 
C

Chad Z. Hower aka Kudzu

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top