Mail

Mail function allows you to send email from web page.

This function works on web server only when the page is viewed with the browser with http:// protocol. You can not send email from local hard disk (by opening local file with the browser).

Testing the mail function

  1. Launch Raptor Web Designer
  2. Create a new project
  3. Choose Insert > PHP
  4. Select "Empty PHP"
  5. Type

    echo mail("you@youremailaddress.com","Email subject","Email message","From: sender@youremailaddress.com");

    Where you@youremailaddress.com should be your email address

  6. Click OK and place PHP item wherever on the page
  7. Choose Website > Upload and send website files to your web server
  8. Open your browser and type http:// path to the web page you've just uploaded
  9. You should see digit 1 indicating the result of mail function (mail sent successfuly)
  10. Check your email for the message

Sending form data with the mail function

  1. Launch Raptor Web Designer
  2. Create a new project
  3. Choose Form > New Form and click OK to create empty form
  4. Double click the form to enter it
  5. Choose Form > Input Field and place the item inside the form
  6. Select the field and press F2, rename the item to "Input1"
  7. Press Esc to exit the form
  8. Choose Page > Insert and create a new page
  9. Choose Insert > PHP
  10. Select "Empty PHP"
  11. Type

    mail("you@youremailaddress.com","Email subject",$_REQUEST['Input1'],"From: sender@youremailaddress.com");

    Where you@youremailaddress.com should be your email address

  12. Click OK and place PHP item wherever on the page
  13. Go back to page with form
  14. Right click the form and choose Send Form Data To
  15. Choose Send to Page and select the page with PHP code, click OK
  16. Choose Website > Upload and send website files to your web server
  17. Open your browser and type http:// path to the web page with form
  18. Enter anything in the input field
  19. Click OK to submit form
  20. Check your email for the message