locked
Email RRS feed

  • Question

  • I am making a email tool. So far i have a

    to box
    from box
    email box to put your email in
    send button
    progress bar to tell the user how much of the email its sent (i cant think of how to put it in better words lol)

    I need the email to be sent to the person its for and the progress bar to work. Can you help me?
    Heres the code i get when i view the code. Oh and if you do help me can you help me on were to put the code in my code cause im new lol
    -----------------------------------------------------------------------------------------------

    Public Class Form1

        Private Sub Label2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label2.Click

        End Sub
    End Class
    Sunday, July 22, 2007 9:32 AM

Answers

  • The internet uses "client-server" relationships. A mail program is a client to an SMTP server just as your webbrowser is a client to a webpage server. SMTP server send mail for you to POP servers from which clients extract mail for reading.

     

    SSL simply means that the smtp server is using a secure protocol. If it is, you have to tell your client code that it needs to talk SSL to the smtp server to which it is connecting.

     

     

    Sunday, July 22, 2007 1:51 PM
  •  

     

    You have to write the code and you have to know things about the SMTP server, of which you are the client.

     

    here is what the code looks like for Gmail:

     

    Public Sub CreateTestMessage1()

    Dim too As String = "Santa@Northpole.com"
    Dim fromm As String = IWasGoodThisYear@email.com
    Dim subject As String = "Using the new SMTP client."
    Dim body As String = "Using this new feature, you can send an e-mail message from an application very easily."
    Dim message As MailMessage = New MailMessage(fromm, too, subject, body)
    Dim client As SmtpClient = New SmtpClient("smtp.gmail.com",587)
    client.Timeout = 10000
    client.EnableSsl =
    True
    client.Credentials = New NetworkCredential("username", "password", "") ' Username does not have @gmail.com
    client.Send(message)

    End Sub

     

     

    In your class you have to import System.Net.Mail

     

    In the event to call the mail.... call a subroutine like CreateTestMessage but as you can see, you have to have the the port paramters (587 in this case) and the address of the smtp server. You have to know if it is SSL and set the parameters accordingly and you have to have a user name and password of the account sending the email.

     

    Although SMTP client has Asynch support, it does not have hooks for progress so there isn't going to be any way to have a progress bar with this class.

    Sunday, July 22, 2007 1:35 PM

All replies

  •  

     

    You have to write the code and you have to know things about the SMTP server, of which you are the client.

     

    here is what the code looks like for Gmail:

     

    Public Sub CreateTestMessage1()

    Dim too As String = "Santa@Northpole.com"
    Dim fromm As String = IWasGoodThisYear@email.com
    Dim subject As String = "Using the new SMTP client."
    Dim body As String = "Using this new feature, you can send an e-mail message from an application very easily."
    Dim message As MailMessage = New MailMessage(fromm, too, subject, body)
    Dim client As SmtpClient = New SmtpClient("smtp.gmail.com",587)
    client.Timeout = 10000
    client.EnableSsl =
    True
    client.Credentials = New NetworkCredential("username", "password", "") ' Username does not have @gmail.com
    client.Send(message)

    End Sub

     

     

    In your class you have to import System.Net.Mail

     

    In the event to call the mail.... call a subroutine like CreateTestMessage but as you can see, you have to have the the port paramters (587 in this case) and the address of the smtp server. You have to know if it is SSL and set the parameters accordingly and you have to have a user name and password of the account sending the email.

     

    Although SMTP client has Asynch support, it does not have hooks for progress so there isn't going to be any way to have a progress bar with this class.

    Sunday, July 22, 2007 1:35 PM
  • Ok im 11 years old been using VB for 2 days i think um i got the bit about the progress bar but the other bit whats a smtp server and SSL
    Sunday, July 22, 2007 1:41 PM
  • The internet uses "client-server" relationships. A mail program is a client to an SMTP server just as your webbrowser is a client to a webpage server. SMTP server send mail for you to POP servers from which clients extract mail for reading.

     

    SSL simply means that the smtp server is using a secure protocol. If it is, you have to tell your client code that it needs to talk SSL to the smtp server to which it is connecting.

     

     

    Sunday, July 22, 2007 1:51 PM
  • I think i get you now so how would i go about making the code for it.
    Sunday, July 22, 2007 1:53 PM
  •  

    The model for the code is up above. As I said, in order to use the code, or variations of it, you have to know the necessary parameters of the smtp server of which your code is a client. Study the example above.

    Sunday, July 22, 2007 2:56 PM
  • If you already have an email app setup on your computer you should be able to get information from that like your smtp mail server . If it is web based like hotmail or gmail then you can probably get information from those sites if they allow external email clients like gmail does .
    Sunday, July 22, 2007 4:01 PM