Click here to Skip to main content
15,922,574 members
Home / Discussions / C#
   

C#

 
AnswerRe: a question about checkboxes ? help please ... Pin
Roy Heil25-May-06 9:49
professionalRoy Heil25-May-06 9:49 
GeneralRe: a question about checkboxes ? help please ... Pin
engsrini25-May-06 19:17
engsrini25-May-06 19:17 
QuestionAdding scrollbar in GDI+ [modified] Pin
cshivaprasad24-May-06 23:04
cshivaprasad24-May-06 23:04 
AnswerRe: Adding scrollbar in GDI+ [modified] Pin
alexey N24-May-06 23:18
alexey N24-May-06 23:18 
GeneralRe: Adding scrollbar in GDI+ [modified] Pin
alexey N24-May-06 23:23
alexey N24-May-06 23:23 
GeneralRe: Adding scrollbar in GDI+ [modified] Pin
cshivaprasad25-May-06 21:16
cshivaprasad25-May-06 21:16 
QuestionCrystal report Pin
ltxuan24-May-06 22:47
ltxuan24-May-06 22:47 
QuestionNeed Super Guru - SMTP unknown error (msg.BodyFormat = ....Mail.MailFormat.... [modified] Pin
ChrisClayko24-May-06 22:14
ChrisClayko24-May-06 22:14 
Hi All,

I have been getting stuck with the weirdest error to do with SMTP. I set up a mail system for a website ive been working on which automatically sends an email when someone submits a form. It was working at first but i hadnt changed the code for a week and when i tried using it again it spat an error. I cut the code down to basics for testing and it still threw an error.

CODE doen in C#.NET {
System.Web.Mail.MailMessage msg = new System.Web.Mail.MailMessage();

msg.To = "anemail@hotmail.com";
msg.From = "anemail@hotmail.com";
msg.Subject = "subject";

the error ---> *****msg.BodyFormat = System.Web.Mail.MailFormat.Html;*****

msg.Body = "body";
System.Web.Mail.SmtpMail.SmtpServer = "localhost";
System.Web.Mail.SmtpMail.Send(msg);
}

The email works without formating to HTML, (ie if it is just text)... but it used to work even with HTML. Im assuming some IIS setting were changed but i can not see how it would allow the email to be sent in text format and not HTML.

------------------------------------------------------------------------------------------
The error is :Exception Details: System.Runtime.InteropServices.COMException: Unknown Error
Stack Trace:

[COMException (0x80040605): Unknown Error]

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters) +0
System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters) +473
System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args) +29
System.Web.Mail.LateBoundAccessHelper.SetProp(Type type, Object obj, String propName, Object propValue)
System.Web.Mail.LateBoundAccessHelper.SetProp(Object obj, String propName, Object propValue)

[HttpException (0x80004005): Could not access 'CDO.Message' object.]
System.Web.Mail.LateBoundAccessHelper.SetProp(Object obj, String propName, Object propValue)
System.Web.Mail.CdoSysHelper.Send(MailMessage message)
System.Web.Mail.SmtpMail.Send(MailMessage message)
ASP.testmail_aspx.__Render__control1(HtmlTextWriter __output, Control parameterContainer) in c:\inetpub\wwwroot\changerequest\testmail.aspx:19
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
System.Web.UI.Control.Render(HtmlTextWriter writer)
System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
System.Web.UI.Page.ProcessRequestMain()


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

If anyone can help me it would be greatly appreciated.
Thanks for your time

Chris Clayko Big Grin | :-D


chris

-- modified at 4:15 Thursday 25th May, 2006
AnswerRe: Need Super Guru - SMTP unknown error (msg.BodyFormat = ....Mail.MailFormat.... [modified] Pin
ranandbe25-May-06 1:52
ranandbe25-May-06 1:52 
Questionlinking from one form to another [modified] Pin
printscreen1234524-May-06 21:52
printscreen1234524-May-06 21:52 
AnswerRe: linking from one form to another Pin
rah_sin24-May-06 22:23
professionalrah_sin24-May-06 22:23 
GeneralRe: linking from one form to another Pin
printscreen1234524-May-06 22:58
printscreen1234524-May-06 22:58 
GeneralRe: linking from one form to another Pin
rah_sin25-May-06 0:12
professionalrah_sin25-May-06 0:12 
QuestionReverse Engineering! Pin
Deepasubramanian24-May-06 21:46
Deepasubramanian24-May-06 21:46 
AnswerRe: Reverse Engineering! Pin
Joe Woodbury24-May-06 21:57
professionalJoe Woodbury24-May-06 21:57 
AnswerRe: Reverse Engineering! Pin
mav.northwind24-May-06 22:48
mav.northwind24-May-06 22:48 
Questionhow to read parcode from scanner [modified] Pin
ahmed shawky24-May-06 21:23
ahmed shawky24-May-06 21:23 
AnswerRe: how to read parcode from scanner [modified] Pin
likefood25-May-06 5:27
likefood25-May-06 5:27 
Questionpopulating treeview control with outlook folders Pin
govind yadav24-May-06 21:18
govind yadav24-May-06 21:18 
QuestionC# comments [modified] Pin
Maddie from Dartford24-May-06 19:52
Maddie from Dartford24-May-06 19:52 
AnswerRe: C# comments Pin
_AK_24-May-06 20:30
_AK_24-May-06 20:30 
AnswerRe: C# comments [modified] Pin
alexey N24-May-06 22:52
alexey N24-May-06 22:52 
GeneralRe: C# comments [modified] Pin
Maddie from Dartford24-May-06 23:40
Maddie from Dartford24-May-06 23:40 
Questionhow to create multicolumn combo box Pin
Mairaaj Khan24-May-06 19:22
professionalMairaaj Khan24-May-06 19:22 
AnswerRe: how to create multicolumn combo box Pin
little finger24-May-06 20:02
little finger24-May-06 20:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.