send mail thru vb

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • preetishrivastava1984
    New Member
    • Oct 2007
    • 6

    send mail thru vb

    Hi All,
    I am trying to send an email thru vb . But whenever I try to change the smtp name to smtp.gmail.com then an error iccurs (Must issue STARTTLS command first bla bla..) can anyone plz help me.

    My code is as follows:
    With poSendMail
    .SMTPHostValida tion = VALIDATE_NONE ' Added to remove msgs that appear inj otlook
    .EmailAddressVa lidation = VALIDATE_SYNTAX ' Added to remove msgs that appear inj otlook
    .Delimiter = "," ' Set any delimiter
    .SMTPHost = "smtp.gmail.com "
    .From = "XYZ@gmail. com"
    .Password = "197400"
    .FromDisplayNam e = " "
    .Recipient = strMailAddress
    .RecipientDispl ayName = "XXX"
    .CcRecipient = ""
    .CcDisplayName = ""
    .BccRecipient = ""
    .ReplyToAddress = ""
    .Subject = "Test Mail"
    .Message = "Testing to send mail thru Visual Basic Application"
    ' .Attachment = ""
    .MaxRecipients = totMailAddress + 30
    .send
    End With
  • shrimant
    New Member
    • Sep 2007
    • 48

    #2
    It basically means that gmail uses STARTTLS authentication and does not support SMTP authentication. ...
    But I beleive that is not the problem in your case Google uses port 465 for SMTP communication, but no where in your code did I see the reference of a Port number. and what ever component you are using should support SSL connection because google uses SSL connection for POP3 and SMTP.
    Originally posted by preetishrivasta va1984
    Hi All,
    I am trying to send an email thru vb . But whenever I try to change the smtp name to smtp.gmail.com then an error iccurs (Must issue STARTTLS command first bla bla..) can anyone plz help me.

    My code is as follows:
    With poSendMail
    .SMTPHostValida tion = VALIDATE_NONE ' Added to remove msgs that appear inj otlook
    .EmailAddressVa lidation = VALIDATE_SYNTAX ' Added to remove msgs that appear inj otlook
    .Delimiter = "," ' Set any delimiter
    .SMTPHost = "smtp.gmail.com "
    .From = "XYZ@gmail. com"
    .Password = "197400"
    .FromDisplayNam e = " "
    .Recipient = strMailAddress
    .RecipientDispl ayName = "XXX"
    .CcRecipient = ""
    .CcDisplayName = ""
    .BccRecipient = ""
    .ReplyToAddress = ""
    .Subject = "Test Mail"
    .Message = "Testing to send mail thru Visual Basic Application"
    ' .Attachment = ""
    .MaxRecipients = totMailAddress + 30
    .send
    End With

    Comment

    • Johnny Mar
      New Member
      • Oct 2007
      • 2

      #3
      I am also new to VB .NET. Is There a VB method available that will return a an application users e-mail provider information, eliminating the need to input the SMTP Server IP information?

      I am worrying about deployment. Many users of this application, including myself, find it difficult to lookup SMTP Information to provide to the application, in order to have the e-mail functionality work properly.

      Comment

      • shrimant
        New Member
        • Sep 2007
        • 48

        #4
        Originally posted by Johnny Mar
        I am also new to VB .NET. Is There a VB method available that will return a an application users e-mail provider information, eliminating the need to input the SMTP Server IP information?

        I am worrying about deployment. Many users of this application, including myself, find it difficult to lookup SMTP Information to provide to the application, in order to have the e-mail functionality work properly.
        Actually Outlook 2007 does it...when you create a new account in Outlook 2007..allyou need to do is provide your complete email address and then Outlook fills all the rest for you.

        Comment

        Working...