Which line throws the exception?
Wild Bill Here's what shows up: VB Code: Source Error: Line 149: End With Line 150: [COLOR=DarkRed]Line 151: SmtpMail.Send(myMessage)[/COLOR] Line 152: lblMessage.Text = "Mail has been sent" Line 153: End Sub Source File: ####.aspx Line: 151 Stack Trace: [InvalidCastException: Specified cast is not valid.] System.Web.Mail.CdoSysHelper.Send(MailMessage message) +769 System.Web.Mail.SmtpMail.Send(MailMessage message) +153 Thanks! Cdog
Source Error: Line 149: End With Line 150: [COLOR=DarkRed]Line 151: SmtpMail.Send(myMessage)[/COLOR] Line 152: lblMessage.Text = "Mail has been sent" Line 153: End Sub Source File: ####.aspx Line: 151 Stack Trace: [InvalidCastException: Specified cast is not valid.] System.Web.Mail.CdoSysHelper.Send(MailMessage message) +769 System.Web.Mail.SmtpMail.Send(MailMessage message) +153
After 3 beers and 2 pots of coffee --> Oops.... VB Code: strFolder = "temps/" 'my original goofy line in my upload sub strFolder = Server.MapPath("temps/") 'changed it to this And added these to the SendMail: VB Code: Dim oAttch1 As MailAttachment = New MailAttachment(StylePath) Dim oAttch2 As MailAttachment = New MailAttachment(PicturePath) And it seems to be happy goodnight Cdog
strFolder = "temps/" 'my original goofy line in my upload sub strFolder = Server.MapPath("temps/") 'changed it to this
Dim oAttch1 As MailAttachment = New MailAttachment(StylePath) Dim oAttch2 As MailAttachment = New MailAttachment(PicturePath)
Forum Rules