Jump to content

Change a simple script from ASP to PHP, newsletter registering


visto

Recommended Posts

I am going to change host and therefore change my ASP things to PHP.

Can someone help med with a PHP script that does the same job as the ASP script below: In the form on the html-webpage you have to write 1) your name, 2) your mailadresse 3) by means of radio buttons chose between getting the newsletter or being removed from the mailinglist.

 

In ASP the script is:

 

<%

set msg = Server.CreateOBject( "JMail.Message" )

msg.Logging = true

msg.silent = true

msg.ContentType = "text/html"

msg.From = Request.Form("Email")

msg.FromName = Request.Form("Name")

msg.AddRecipient "info@mydomaine.dk", "mydomaine.dk"

msg.Subject = "Concerning newsletter"

msg.Body = "Fra:<br>" & Request.Form("Name") & "<br><br>Email:<br>" & Request.Form("Email") & "<br><br>Wish:<br>" & Request.Form("M")

if not msg.Send("localhost" ) then

Response.write "<pre>" & msg.log & "</pre>"

else

Response.write "<p class=""message""><br><br>You shall have a confirmation when you are registred</p>"

end if

Set msg = Nothing

%>

 

(I can see that pre- and br-tags were removed above), so the script is not accurate, but I hope you get the idea.)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.