Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6573977
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:12:06+00:00 2026-05-25T15:12:06+00:00

I am a PHP Developer and I do not have any knowledge about ASP

  • 0

I am a PHP Developer and I do not have any knowledge about ASP. Sadly I am the only developer here and a client had ASP (not ASP.NET) pages and they wanted a “Contact Us” Form.

I searched the internet to find out how to serve ASP files in Apache and it pointed me to mod_aspdotnet. It was so stupid of me to think that ASP is the same as ASP.NET! Now do you see my problem? I have developed a working ASP.NET email script. The files had .aspx extensions but the actual site had .asp extensions, they were using ASP and not ASP.NET!

So I would like to ask for help. This is my email script:

<%@ Page Language="VB" Debug="true" %>
<%@Import Namespace="System.Web.Mail" %>
<script language="vb" runat="server">

Sub Send2Mail (sender as Object, e as EventArgs)

    Dim objMail as New MailMessage()

    if Logo.HasFile Then
        Try
            Logo.SaveAs(Server.MapPath("uploads/") + Request.form("strName") + "_Logo_" + Logo.FileName)
            objMail.Attachments.Add(new MailAttachment(Server.MapPath("uploads/" + Request.form("strName") + "_Logo_" + Logo.FileName)))
        Catch ex As Exception
            msg.Text = "<b>The Logo could not be uploaded</b>. The following error occured: <i>" + ex.Message + "</i><br />"
            msg.Visible = true
        end try
    end if  

    if Image1.HasFile Then
        Try
            Image1.SaveAs(Server.MapPath("uploads/") + Request.form("strName") + "_Image1_" + Image1.FileName)
            objMail.Attachments.Add(new MailAttachment(Server.MapPath("uploads/" + Request.form("strName") + "_Image1_" + Image1.FileName)))
        Catch ex As Exception
            msg.Text = "Image 1 could not be uploaded. The following error occured: <i>" + ex.Message + "</i><br />"
            msg.Visible = true
        end try
    end if  

    if Image2.HasFile Then
        Try
            Image2.SaveAs(Server.MapPath("uploads/") + Request.form("strName") + "_Image2_" + Image2.FileName)
            objMail.Attachments.Add(new MailAttachment(Server.MapPath("uploads/" + Request.form("strName") + "_Image2_" + Image2.FileName)))
        Catch ex As Exception
            msg.Text = "Image 2 could not be uploaded. The following error occured: <i>" + ex.Message + "</i><br />"
            msg.Visible = true
        end try
    end if


    objMail.To = "example@example.com"
    objMail.From = """Us"" <do-not-reply@foo.com>"

    objMail.BodyFormat = MailFormat.Html
    objMail.Priority = MailPriority.Normal
    objMail.Subject = "Business Registration"

    objMail.Body = "<html><body style='font-family: Verdana'><table style='font-family: Verdana; font-size: 11px'>"
    objMail.Body += "<tr><td><b>Business Name:</b></td><td>" + Request.form("strName") + "</td></tr>"
    objMail.Body += "<tr><td><b>Opening Business Description:</b></td><td>" + Request.form("strOpenDesc") + "</td></tr>"
    objMail.Body += "<tr><td><b>Opening Hours:</b></td><td>" + Request.form("strHours") + "</td></tr>"
    objMail.Body += "<tr><td><b>Business Description:</b></td><td>" + Request.form("strBusDesc") + "</td></tr>"
    objMail.Body += "<tr><td><b>Servicing Area:</b></td><td>" + Request.form("strService") + "</td></tr>"
    objMail.Body += "<tr><td><b>Website Address:</b></td><td>" + Request.form("strWebsite") + "</td></tr>"
    objMail.Body += "<tr><td><b>Email Address:</b></td><td>" + Request.form("strEmail") + "</td></tr>"
    objMail.Body += "<tr><td><b>Telephone Number:</b></td><td>" + Request.form("strPhone") + "</td></tr>"
    objMail.Body += "<tr><td><b>Fax Number:</b></td><td>" + Request.form("strFax") + "</td></tr>"
    objMail.Body += "<tr><td><b>Mobile Phone Number:</b></td><td>" + Request.form("strMobile") + "</td></tr>"
    objMail.Body += "<tr><td><b>Suburb / Post Code:</b></td><td>" + Request.form("strPostCode") + "</td></tr>"
    objMail.Body += "<tr><td><b>Proprietor Name:</b></td><td>" + Request.form("strPropName") + "</td></tr>"
    objMail.Body += "<tr><td><br /></td></tr>"
    objMail.Body += "<tr><td><b>Image 1 Caption:</b></td><td>" + Request.form("strImage1Caption") + "</td></tr>"
    objMail.Body += "<tr><td><b>Image 2 Caption:</b></td><td>" + Request.form("strImage2Caption") + "</td></tr>"
    objMail.Body += "</table><body></html>"

    SmtpMail.SmtpServer = "localhost"

    Try
        SmtpMail.Send(objMail)
        strMessage.Visible = true
    Catch ex As Exception
        msg.Text = "<b>The message was not sent</b>. The following error occured: <i>" + ex.Message + "</i><br />"
        msg.Visible = true
    End Try

End Sub

Will this work in ASP as it is? What do I need to change to make it work in ASP? I am also using the <asp:></asp:> tags. Will this work in ASP?

EDIT

I am sorry for the confusion of what server I am using for development and the host server. The host is using IIS. I am using Apache because I am really a PHP developer. The problem about running ASP pages in Apache was because the client does not want to give me access to their server. They told me that I should just deliver the files.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T15:12:06+00:00Added an answer on May 25, 2026 at 3:12 pm

    ASP and ASP.NET share names for pure marketing reasons but they are basically unrelated technologies, although the latter reuses concepts (such as being a language agnostic framework) and even some method names (such as Server.MapPath).

    In both ASP’s, you have to pick a supported programming language and code your scripts with it. Your sample code seems to use VisualBasic, which was not supported by classic ASP. You’ll have to switch to (e.g.) VBScript. Unlike VisualBasic, VBScript is loosely typed, but apart from that it has a similar syntax.

    The classic ASP way to send e-mail is the CDONTS library. A simple example:

    <%
    
    set mailer = CreateObject("CDONTS.NewMail")
    mailer.from = "foo@example.com"
    mailer.to = "bar@example.com"
    mailer.subject = "Test e-mail message"
    mailer.body = "This is the message body."
    mailer.send
    set mailer = nothing
    
    %>
    

    In general, classic ASP was very similar to PHP: you embed code in your HTML documents.

    The difficult part is file upload handling. ASP did not have a native file upload feature: you had to purchase and install a binary commercial library or find one of the VBScript-only code snippets available at the Internet.

    Edit: Does your client really run ASP over Apache? Microsoft only supports IIS. Apache modules for ASP were normally written by third-parties and often implemented different languages like Perl.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Firstly I just want to say I'm not an ASP developer, I'm PHP through
I am not a PHP developer at heart and I have been asked to
I have been a long-term .NET developer, but dabble in Java and PHP development
I'm not a PHP developer but i've seen in a couple of places that
Being a pretty experienced PHP developer, and having a fair knowledge of C (Wrote
I am a PHP developer exploring the outside world. I have decided to start
As far as I can tell, the only reason we have namespacing in PHP
I am not a PHP developer but I'm assessing the security of a PHP5
I'm a .Net developer but I have a situation where I can't guarantee that
I am hoping there are numerous Twilio developer here along with PHP scripters...I am

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.