Results 1 to 3 of 3

Thread: Error in sending Email Application

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2006
    Posts
    4

    Question Error in sending Email Application

    Hello all
    I have written following code to send an email. but getting an error of
    Message "Specified cast is not valid." String on the following line
    SmtpMail.Send(ObjEmail)



    Dim SmtpMail As SmtpMail
    Dim ObjEmail As New MailMessage

    SmtpMail.SmtpServer = "mail.suvana.com"
    ObjEmail.BodyFormat = MailFormat.Text
    ObjEmail.From = "[email protected]"
    ObjEmail.Attachments.Add("C:\ajay1.pdf")
    ObjEmail.To = "[email protected]"
    'ObjEmail.Cc =
    ObjEmail.Subject = "Test Mail From Infosys..."
    ObjEmail.Body = " Hi this is Ajay"
    SmtpMail.Send(ObjEmail)

    SmtpMail = Nothing
    ObjEmail = Nothing

  2. #2
    Lively Member
    Join Date
    May 2004
    Posts
    104

    Re: Error in sending Email Application

    ObjEmail.From = "[email protected]"

  3. #3
    Hyperactive Member francisstokes's Avatar
    Join Date
    May 2005
    Location
    Kent, England
    Posts
    272

    Re: Error in sending Email Application

    Its always the simplest errors that go through .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width