Results 1 to 2 of 2

Thread: ASP Mail function

  1. #1
    Senior Member stu2000's Avatar
    Join Date
    Jan 2009
    Posts
    566

    Default ASP Mail function 3 Feb 2011 @ 15.19

    Hi there,

    Does anyone know if ASP has a mail() function like PHP does? I need to send non authenticated mail through ASP as the mail server is on a different server to the site, and the authentication method that's being used at the moment is rejecting any mail being sent because the code is on a different server to the mail accounts (much like PHP's PEAR mail feature does).

    Thanks!

    Stu
      Reply With Quote

  2. #2
    New Registered User marchse's Avatar
    Join Date
    Sep 2011
    Posts
    1

    Default 28 Sep 2011 @ 07.02

    [FONT=Courier New][SIZE=2]<%@ Import Namespace="System.Web.Mail"%>

    <%
    [FONT=Courier New]Dim[/FONT] objMail [FONT=Courier New]As[/FONT] [FONT=Courier New]New[/FONT] System.Web.Mail.MailMessage()

    objMail.From = "recipient_address1@domain.com"
    objMail.To = "recipient_address2@domain.com"
    objMail.Subject = "The Subject Line"
    objMail.BodyFormat = MailFormat.Html 'MailFormat.Text to send plain text email
    objMail.Priority = MailPriority.High
    objMail.Body = "********************<BR>" & _
    "Thank you for visiting my website" & _
    "********************<BR>"

    System.Web.Mail.SmtpMail.SmtpServer = "mail.yoursmtpserver.com"
    System.Web.Mail.SmtpMail.Send(objMail)
    objMail = [FONT=Courier New]Nothing[/FONT]

    %>[/SIZE][/FONT]
    Last edited by WelshStew; 5 Oct 2011 at @ 07.51. Reason: remove forced signature
      Reply With Quote

Similar Threads

  1. mail server questions
    By silversurfer5150 in forum PHP, ASP & Java
    Replies: 4
    Last Post: 25 Feb 2011, @ 22.05
  2. E-mail signatures
    By Gaz in forum HTML & CSS
    Replies: 7
    Last Post: 19 Mar 2009, @ 05.08
  3. js function help?
    By ljackson in forum Javascript Libraries
    Replies: 15
    Last Post: 11 Mar 2009, @ 10.31
  4. PHP Copy() function
    By stu2000 in forum PHP, ASP & Java
    Replies: 3
    Last Post: 20 Jan 2009, @ 19.52

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •