how to send mail to pop3 mail server

networking Malaysia
  • 15 years ago

    pls help me to code in sending mails to pop3 mail server using VB.NET
    urgent, pls help.
    10s

  • 15 years ago
    Again

    You cann't send mails to a POP3 server... It is ued to recieve mails NOT to send...
    SMTP is used to send mails...
  • 15 years ago

    it depends how strict you are being in your use of language. technically you are sending it to the POP3 server, cos it ends up there but you're not using the POP3 server to send, you're using the SMTP server to send it.


    here's an example in ASP of how to send mail:

    Code:
         Set objNewMail = CreateObject("CDONTS.NewMail")
         MsgFrom = "[email protected]"
         MsgTo = Request.Form("email")
         MsgSubject =  "This is an email"
         MsgMessage = "Hello, this is my email"
         objNewMail.Send MsgFrom, MsgTo, MsgSubject, MsgMessage

  • 15 years ago

    oooooooooooooops!!!


    Here is another example...

    Code:

       Set JMail = Server.CreateObject ("JMail.SMTPMail")
       JMail.Silent = True
       JMail.Logging = True
       JMail.ContentType = "text/html"
       JMail.SenderName = SenderName
       JMail.Sender = SendersEMail
       JMail.Subject = "any subject"
       JMail.AddRecipient "[email protected]"
       JMail.Body = strMessageBody
       JMail.Priority = 3
       JMail.AddHeader "Originating-IP", Request.ServerVariables("REMOTE_ADDR")
       If NOT JMail.Execute Then
           Result = "ERROR MESSAGE: " & JMail.ErrorMessage & "<BR>" & vbcrlf
           Result = Result & "ERROR SOURCE: " & JMail.ErrorSource & "<BR>" & vbcrlf
           Result = Result & "LOG: <pre> " & JMail.Log & "</pre" & vbcrlf
           Response.Write "Following Error Occured While Sending The Registration Information:" & Result
       End If
       Set JMail = Nothing

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.” - Brian Kernighan