SmtpMail.SmtpServer

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • destiple
    New Member
    • Feb 2009
    • 1

    SmtpMail.SmtpServer

    I'm having issues with an aspx script. It is rejecting any submissions from people with gmail accounts.

    Could this be because the smtp server it is trying to use doesn't exists or allow outgoing mail?

    My smtp server (smtpout.secure server.net) requires authentication.

    What can I do about this?

    My script is below:
    Code:
    <%@ Page Language="vb" AutoEventWireup="true" %>
    <%@ Import Namespace="System.Web.Mail" %>
    <script runat="server">
        Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
    
            ' Need an SMTP Mail object, which will send the actual mail.
    
            ' Use the local SMTP server.  If using a server other than the web server, that
            ' name should be specified here instead of String.Empty
            SmtpMail.SmtpServer = String.Empty
    
            ' Create a new mail message
            Dim message As MailMessage = New MailMessage
            ' Just a plain text message, use MailFormat.Html for an HTML message
            message.BodyFormat = MailFormat.Html
            ' You can use high priority, but you will most likely just leave it like this...
            message.Priority = MailPriority.Normal
            ' Probably replace the message.From line with this instead:
            message.From = Request("email")
            ' message.From = "sender@example.com"
            ' The address goes here.  I put the forms one in to test, but it will
            ' probably look like this:
            message.To = "subscribe@theslangs.com"
            ' A CC here.  If no CC, just leave the comment on the next line
            message.Cc = ""
            ' Subject
            message.Subject = "The Slangs - Mailing List Signup"
            ' Your body goes here.  You can build huge strings--this is just a simple 
            ' example.
            message.Body = String.Format("{0} would like to be added to The Slang's e-mailing list.", Request("email"))
            ' This line is what actually sends the mail.
            SmtpMail.Send(message)
            ' Forward the person off to a thank-you page.
            Response.Redirect("http://www.theslangs.com/thanks.asp")
    
        End Sub
    </script>
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    This is an ASP.NET 1.1 project (as opposed to 2.0 or 3.x) then right, since you are using objects that were replaced in the later versions.

    I believe you are going to need to upgrade or find a 3rd party smtp solution there.
    Pretty sure I remember reading that 1.1's smtpserver didn't support authenticating.

    Comment

    • shrimant
      New Member
      • Sep 2007
      • 48

      #3


      May be this old article helps

      Comment

      Working...