I'm just trying to email from a form and I get this nasty error...no idea why. Old Asp works on my server but asp.net doesn't<BR><BR>here is a code clip<BR><BR>MailMessage MyMessage = new MailMessage();<BR>MyMessage.To = "[email protected]";<BR>("SendTo");// emails[SendTo.SelectedItem.Value].ToString();<BR> MyMessage.From = Request.Form["From"];<BR> MyMessage.Subject = Request.Form["Subject"];<BR> MyMessage.BodyFormat = MailFormat.Text;<BR> MyMessage.Body = "some sample text";<BR> //SmtpMail.SmtpServer = "";<BR> try<BR> {<BR> SmtpMail.Send(MyMessage);<BR> }<BR> catch(Exception e)<BR> {<BR> Response.Write(e.Message);<BR> } <BR><BR><BR>e writes: Could not access 'CDO.Message' object.Did you reference the CDO Library? Try using the CDONTS library.<BR>Are you not using an NT system? CDO doesn't work on 9x.Hiee Both Of u...<BR>same error for me too...... it says SendUsing Config is invalid......<BR>None of any books and online tutorials discuss this Imp Issue.....<BR>I am using win2k with .net final release upgraded with service pack 1....my Default SMTP Server is running.......<BR>How to reference CDO .........<BR><BR>Help<BR>Dhirajhttp://msdn.microsoft.com/library/default.asp?url=/library/en-us/wss/wss/_cdo_message_coclass.asp<BR><BR>But MSDN *does* talk about it. Just type SendUsing Config into the seach bar. <BR><BR>Check out taht link, see if it helps you. Otherwise, see what the other results lead you to
n top of that...Try typeing SendUsing Config CDO into Google. More results for your perusal.using System;<BR>using System.Web;<BR>using System.Web.Mail;<BR>namespace kbAlertz<BR>{<BR> public class test2 : System.Web.UI.Page<BR> {<BR> private void Page_Load(object sender, System.EventArgs e)<BR> {<BR> MailMessage msg = new MailMessage();<BR> msg.From= "[email protected]";<BR> msg.To = "[email protected]";<BR> msg.Subject = "Hello";<BR> msg.Body = "It works!";<BR> SmtpMail.SmtpServer = "mail.kbAlertz.com";<BR> SmtpMail.Send( msg );<BR> Response.Write ("<BR>sent!");<BR> }<BR> }<BR>}Hiee<BR>Finally i did it...but i entered ip address of our company website....... wht about localhost machiness<BR>Noone knows tht?<BR>DhirajHiee<BR>Finally i did it...but i entered ip address of our company website....... wht about localhost machiness<BR>Noone knows tht?<BR>Dhiraj<BR>It seems to work fine with the code you provided (when I specified a mail server that will relay messages initiated by my server).<BR><BR>However, let me ask you this. How can you get it to simply use the default CDONT mail server like in the original ASP:<BR><BR>Set objMail = Server.CreateObject("CDONTS.NewMail")<BR><BR>Know how to do that with C# and ASP.net ??<BR><BR>LonnieIf you do not specify any smtpserver then by default the CDONTS uses the local server which is your machine. Check if your machine can access the exchange server used to send the emails.
