• 0

ASP Help?


Question

I'm tryin to make this Sendmail code to send the result of a form to an e-mail, kinda like a contact form. Its been a long time since I've done this and i've lost my touch. could someone help me out?

<%
 ?Dim email, name, age, grade, address, phone, email, mom, dad
 ?Dim Mailer
 ?
 ?Set Mailer = Server.CreateObject("SMTPsvg.Mailer") ?'create Mailer object
 ?email = Request.QueryString("email") ? ' Get e-mail from querystring/form
 ?name = Request.QueryString("frstname") & " " Request.QueryString("lstname") ' Get name from querystring/form
 ?age = Request.QueryString("age")
 ?
 ?Mailer.FromName ? = name ?
 ?Mailer.FromAddress= "contactus@lala.com
 ?Mailer.RemoteHost = "smtp.lala.com" ?'Name of your mail host
 ?Mailer.AddRecipient "LALA Employee", personatthrive@lala.com 'Recipient
 ?Mailer.Subject ? ?= "Contact E-mail"
 ?Mailer.BodyText ? = "E-mail : " & email & "Name: " & name
 ?Mailer.SendMail ?'Send mail
 ?Set Mailer = Nothing
%>

That isn't complete, but I'm confused of where to go from there. It supposed to send the following fields to an e-mail, either formated with HTML or plain text

Fields:

First Name

Last Name

Age

Grade

Address

City

State

Zip

Phone

E-Mail

Mother's Name

Father's Name

Programs (Array of 6)

Thanks

splendore0@msn.com

Link to comment
https://www.neowin.net/forum/topic/279433-asp-help/
Share on other sites

11 answers to this question

Recommended Posts

  • 0
  Vafer1 said:
I'm tryin to make this Sendmail code to send the result of a form to an e-mail, kinda like a contact form. Its been a long time since I've done this and i've lost my touch. could someone help me out?

<%
  Dim email, name, age, grade, address, phone, email, mom, dad
  Dim Mailer
  
  Set Mailer = Server.CreateObject("SMTPsvg.Mailer")  'create Mailer object
  email = Request.QueryString("email")   ' Get e-mail from querystring/form
  name = Request.QueryString("frstname") & " " Request.QueryString("lstname") ' Get name from querystring/form
  age = Request.QueryString("age")
  
  Mailer.FromName   = name  
  Mailer.FromAddress= "contactus@lala.com
  Mailer.RemoteHost = "smtp.lala.com"  'Name of your mail host
  Mailer.AddRecipient "LALA Employee", personatthrive@lala.com 'Recipient
  Mailer.Subject    = "Contact E-mail"
  Mailer.BodyText   = "E-mail : " & email & "Name: " & name
  Mailer.SendMail  'Send mail
  Set Mailer = Nothing
%>

That isn't complete, but I'm confused of where to go from there. It supposed to send the following fields to an e-mail, either formated with HTML or plain text

Fields:

First Name

Last Name

Age

Grade

Address

City

State

Zip

Phone

E-Mail

Mother's Name

Father's Name

Programs (Array of  6)

Thanks

splendore0@msn.com

585397104[/snapback]

You need to get the Form information from the Request object's Form collection. Then you can access the Form's fields by name/id.

Link to comment
https://www.neowin.net/forum/topic/279433-asp-help/#findComment-585397901
Share on other sites

  • 0

It's the same most of the time, if you are sending it to a webmail based system like Hotmail, it automatically will strip that part and just display the <BODY>, in Outlook and those ones, the complete file is parsed with <HTML> existing or not, so I recommend you to send a complete <HTML> document and if you are putting CSS styles in the mail put them to be inline because most of the time the <HEAD> part is stripped out in websystems and local ones..

Link to comment
https://www.neowin.net/forum/topic/279433-asp-help/#findComment-585414104
Share on other sites

  • 0

ANYONE see anything wrong?

[/code]<% Dim email, name, age, grade, addy, phone, email, mom, dad

Dim Mailer

Set Mailer = Server.CreateObject("SMTPsvg.Mailer") 'create Mailer object

email = Request.QueryString("email") ' Get e-mail from querystring/form

' name = Request.QueryString("frstname") & " " 'Request.QueryString("lstname") ' Get name from querystring/form

' age = Request.QueryString("age")

Mailer.FromName = "Jeff Greener"

Mailer.FromAddress= "contactus@lala.com"

Mailer.RemoteHost = "smtp.cox.net" 'Name of your mail host

Mailer.AddRecipient "LALA Employee", "splendore0@msn.com" 'Recipient

Mailer.Subject = "Contact E-mail"

Mailer.BodyText = "<html>

<head>

<title>E-Mail from website </title>

</head>

<body>

<p>First Name: " & frstname & "<br>

Last Name: " & lstname & "<br>

Age: " & age &"<br>

Grade: " & grade & "<br>

Address: " & addy & "<br>

City: " & city & "<br>

State: " & state & "<br>

Zip: " & zip & "<br>

Phone: " & phone &"<br>

E-Mail: " & email & "<br>

Mother's Name: " & mname & "<br>

Father's Name: " & fname & "</p>

</body>

</html>"

Mailer.SendMail 'Send mail

Set Mailer = Nothing

%>


I can't figure it out, i thought i was doing it right but i think im wrong....

Link to comment
https://www.neowin.net/forum/topic/279433-asp-help/#findComment-585437534
Share on other sites

  • 0

The biggest problem with this is that you cannot have line breaks within your body text.

You can do:

Mailer.BodyText = "&lt;html&gt;&lt;head&gt;&lt;title&gt;E-Mail from website &lt;/title&gt;&lt;/head&gt;&lt;body&gt;..." 

so that the body text is all on one line.

OR

you can do:

Dim strBody

strBody = ""
strBody = strBody "&lt;html&gt;"
strBody = strBody "  &lt;head&gt;"
strBody = strBody "    &lt;title&gt;E-Mail from website &lt;/title&gt;"
strBody = strBody "  &lt;/head&gt;"
strBody = strBody "  &lt;body&gt;"... 

Mailer.BodyText = strBody

Try this and let me know if this work or if you are still encountering problems.

Link to comment
https://www.neowin.net/forum/topic/279433-asp-help/#findComment-585439706
Share on other sites

  • 0

&lt;% Dim email, name, age, grade, addy, phone, email, mom, dad
 Dim Mailer

 Set Mailer = Server.CreateObject("SMTPsvg.Mailer")  'create Mailer object
 email = Request.QueryString("email")   ' Get e-mail from querystring/form
 name = Request.QueryString("frstname") &amp; " " Request.QueryString("lstname") ' Get name from querystring/form
 age = Request.QueryString("age")


 Mailer.FromName   = name  
 Mailer.FromAddress= "contactus@lala.com"
 Mailer.RemoteHost = "smtp.cox.net"  'Name of your mail host
 Mailer.AddRecipient "LALA Employee", "splendore0@msn.com" 'Recipient
 Mailer.Subject    = "Contact E-mail"
 Mailer.BodyText   = "&lt;html&gt;&lt;head&gt;&lt;title&gt;E-Mail from website &lt;/title&gt;&lt;/head&gt;&lt;body&gt;&lt;p&gt;First Name: " &amp; frstname &amp; "&lt;br&gt;Last Name: " &amp; lstname &amp; "&lt;br&gt;Age: " &amp; age &amp;"&lt;br&gt;Grade: " &amp; grade &amp; "&lt;br&gt;Address: " &amp; addy &amp; "&lt;br&gt;City: " &amp; city &amp; "&lt;br&gt;State: " &amp; state &amp; "&lt;br&gt;Zip: " &amp; zip &amp; "&lt;br&gt;Phone: " &amp; phone &amp;"&lt;br&gt;E-Mail: " &amp; email &amp; "&lt;br&gt;Mother's Name: " &amp; mname &amp; "&lt;br&gt;Father's Name: " &amp; fname &amp; "&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;"
 Mailer.SendMail  'Send mail
 Set Mailer = Nothing
%&gt;

Whats wrong now? still server error, could it be the content type? anyone remember the mailer. extension for it?

Link to comment
https://www.neowin.net/forum/topic/279433-asp-help/#findComment-585454018
Share on other sites

  • 0

Your missing an "&" between the " " and Request.QueryString("lstname") :

 name = Request.QueryString("frstname") &amp; " " Request.QueryString("lstname")

Should be:

 name = Request.QueryString("frstname") &amp; " " &amp; Request.QueryString("lstname")

If this still doesn't fix it, do you know what the error is or are you just getting the "Page Cannot Be Displayed Error?" If the latter, than have you tried injecting any error catching to display where the error might be occuring?

Oh, try adding this code to catch any smpt errors:

 Mailer.SMTPLog = "c:\smtplog.txt"

Link to comment
https://www.neowin.net/forum/topic/279433-asp-help/#findComment-585458350
Share on other sites

  • 0

I am getting ERROR 500, internal server error. Put that fix in and still doesnt work..

Does anyone have the resources to test this page on their site?

And the smptlog doenst create even after changing permissions,

THis is all my server log says...

[sat Feb 12 21:59:52 2005] [error] [client 68.98.23.118] File does not exist: /home/kentco2/public_html/500.shtml

[sat Feb 12 21:58:57 2005] [error] [client 68.98.23.118] File does not exist: /home/kentco2/public_html/500.shtml

[sat Feb 12 21:58:57 2005] [error] [client 68.98.23.118] File does not exist: /home/kentco2/public_html/404.shtml

and yes ASP is enabled.

Link to comment
https://www.neowin.net/forum/topic/279433-asp-help/#findComment-585461999
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Mozilla shuts down even more Firefox services you might still be using by David Uzondu A few weeks ago, Mozilla announced that its Pocket and Fakespot services were getting the axe as the company focuses more on Firefox. It is a complete shutdown. Pocket, the read-it-later service Mozilla bought in 2017, will stop working on July 8, 2025. You have until October 8 to get your saved articles out before they are deleted forever. Fakespot, which helped you spot garbage product reviews, is also being sunsetted. But the house cleaning does not stop with those two. Neowin has spotted a shutdown notice dated June 26, 2025 for Deep Fake Detector, the Firefox extension that was supposed to tell you if a piece of text was written by a human or an AI chatbot. That tool used a combination of Mozilla's own proprietary ApolloDFT engine and open-source models like ZipPy to give you a verdict on what you were reading. The notice says: This brings us to the AI tools. Following the pattern, the Orbit website was updated with a banner that announced the service would shut down by June 26. Orbit was Mozilla's big privacy-first experiment in AI. It was a Firefox add-on that could summarize articles and answer questions about a webpage's content without sending your data to a third party. This is not an AI exit. Mozilla is simply changing how it delivers AI features. Orbit's private, self-contained setup can be replaced with the new sidebar built directly into Firefox, letting you connect to third-party chatbots like ChatGPT and Gemini. But, for Orbit users, this is still a huge loss, as a key feature of the service was privacy. Your prompts were handled by Mistral LLM (Mistral 7B) within Mozilla's GCP instance and were not shared with other companies for model training, which was a huge selling point for people tired of being the product. Mozilla keeps saying these cuts are necessary. As the only major browser not owned by a tech giant, its resources are limited; hence, the need to focus its cash and engineering talent on the core Firefox browser to compete.
    • Too close to the Ultra, I have and love an Ultra but have held onto my watch 6 classic because it is nicer when wearing a suit to work.
    • Intel v32.0.101.6881 graphics driver fixes a popular multiplayer hero shooter by Taras Buria Intel is rolling out a new graphics driver under version 32.0.101.6881. This WHQL release does not contain much. In fact, there is only a single fix for a popular multiplayer hero shooter. The new driver fixes crashes when launching Overwatch 2 (DirectX 12) on High or Ultra graphics settings on Intel Arc A-Series graphics cards. From the changelog: Overwatch 2 (DX12) may experience an application crash while launching the game with High or Ultra graphics quality settings. Known bugs in the drive include the following: Intel Arc B-Series Graphics Products: Fortnite may experience an application crash when “Performance - Lower Graphical Fidelity” is selected as Rendering Mode. Recommendation is to use default Rendering Mode – DX12. Visual corruptions may appear in certain scenarios with multiple application interactions. Call of Duty: Black Ops 6 (DX12) may exhibit flickering corruption in certain scenes during gameplay. Returnal (DX12) may experience an application crash during gameplay with Ray-Tracing settings turned on. Call of Duty: Warzone 2.0 (DX12) may exhibit corruptions on water areas in certain scenarios. SPECapc for Maya 2024 may experience intermittent application freeze during benchmark. PugetBench for Davinci Resolve Studio V19 may experience an application crash while running the benchmark. HWiNFO may incorrectly report number of Xe Cores for certain Intel Arc B-Series Graphics Products. Intel Arc A-Series Graphics Products: Returnal (DX12) may experience an application crash during gameplay with Ray-Tracing settings turned on. Marvel’s Spider-Man 2 (DX12) may experience an application crash with Ray-Tracing and XeSS enabled. PugetBench for Davinci Resolve Studio V19 may experience an application crash while running the benchmark. Intel Core Ultra Series 1 with built-in Intel Arc GPUs: Adobe Premiere Pro may fail to import video. Mitigation is to use Intel NPU Driver version 32.0.100.3717 or lower. PugetBench for Davinci Resolve Studio V19 may experience errors intermittently with benchmark preset set to Extended. Intel Core Ultra Series 2 with built-in Intel Arc GPUs: Valorant (DX11) may fail to enumerate supported resolutions in game settings. Adobe Premiere Pro may experience an intermittent application crash. Adobe Premiere Pro may fail to import video. Mitigation is to use Intel® NPU Driver version 32.0.100.3717 or lower. PugetBench for Davinci Resolve Studio V19 may experience errors intermittently with benchmark preset set to Extended. You can install Intel 32.0.101.6881 WHQL driver on PCs with 64-bit Windows 10 and Windows 11 with the following graphics products from Intel: Discrete GPUs Integrated GPUs Intel Arc A-Series (Alchemist) Intel Arc B-Series (Battlemage) Intel Iris Xe Discrete Graphics (DG1) Intel Core Ultra Series 2 (Lunar Lake and Arrow Lake) Intel Core Ultra (Meteor Lake) Intel Core 14th Gen (Raptor Lake Refresh) Intel Core 13th Gen (Raptor Lake) Intel Core 12th Gen (Alder Lake) Intel Core 11th Gen (Tiger Lake) You can download the driver from the official website here. Full release notes are available here (PDF).
    • Just look at the shiney shiney Vista clone, ignore the fact that they are a disaster in anything AI related. Roll on the class actions for all iPhone 16 owners.
  • Recent Achievements

    • Collaborator
      Carltonbar earned a badge
      Collaborator
    • Explorer
      MusicLover2112 went up a rank
      Explorer
    • Dedicated
      MadMung0 earned a badge
      Dedicated
    • Rookie
      CHUNWEI went up a rank
      Rookie
    • Enthusiast
      the420kid went up a rank
      Enthusiast
  • Popular Contributors

    1. 1
      +primortal
      508
    2. 2
      ATLien_0
      268
    3. 3
      +FloatingFatMan
      248
    4. 4
      +Edouard
      201
    5. 5
      snowy owl
      168
  • Tell a friend

    Love Neowin? Tell a friend!