Results 1 to 6 of 6

Thread: why is this email not sending

  1. #1

    Thread Starter
    Fanatic Member d2005's Avatar
    Join Date
    Aug 2005
    Location
    ireland
    Posts
    620

    why is this email not sending

    why is this email not sending

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

    setting up the email to send email when a button is clicked

    check it out, no errors but no email either


    Code:
    Private Sub CompRegConfirmation()

    Dim msg As New MailMessage

    msg.From = "localhost"

    msg.To = "[email protected]"

    msg.Subject = " Company registered"

    msg.Body = txtUsername.Text

    msg.BodyFormat = MailFormat.Html

    SmtpMail.SmtpServer = "localhost"

    SmtpMail.Send(msg)

    End Sub


    i call this then in a button click event
    compregconfirmation()

    no joy
    __________________
    im a newbie so be nice
    it works 60% of the time, all the time.

  2. #2
    Hyperactive Member
    Join Date
    Apr 2003
    Location
    Three Rivers, MI
    Posts
    354

    Re: why is this email not sending

    What error are you getting?

  3. #3
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    Re: why is this email not sending

    i bet its the typical CDOSYS (or something like that) error msg...

  4. #4
    Hyperactive Member
    Join Date
    Apr 2003
    Location
    Three Rivers, MI
    Posts
    354

    Re: why is this email not sending

    My first thought was that he didn't have SMTP services running or something. I tried the code the way he pasted it and couldn't get it to work using localhost either. Once I named the SMTP server it worked fine. There must be a way to do it like that but I couldn't come up with the right way off the top of my head.

    I didn't go that far into it or post more details because I wanted to know the error he was getting first.

  5. #5

    Thread Starter
    Fanatic Member d2005's Avatar
    Join Date
    Aug 2005
    Location
    ireland
    Posts
    620

    Re: why is this email not sending

    im not getting no errors guys
    how do you name the smtp server
    it works 60% of the time, all the time.

  6. #6

    Thread Starter
    Fanatic Member d2005's Avatar
    Join Date
    Aug 2005
    Location
    ireland
    Posts
    620

    Re: why is this email not sending

    suprisingly enough this still isnt working
    anyone any inspiring ideas

    VB Code:
    1. Private Sub CompRegConfirmation()
    2.         Dim msg As New MailMessage
    3.         msg.From = "[email protected]"
    4.         msg.To = "[email protected]"
    5.         msg.Subject = " Company registered"
    6.         msg.Body = txtUsername.Text
    7.         msg.BodyFormat = MailFormat.Html
    8.         SmtpMail.SmtpServer = "localhost"
    9.         SmtpMail.Send(msg)
    10.     End Sub
    it works 60% of the time, all the time.

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