Knowledgebase
How do I send mail from my website using a script?
Posted by Sean Syed on 20 February 2013 06:42 PM
It is possible to use DNN4Less SMTP servers to send email from your web scripts. However to preserve the integrity of our networks, there are some limitations in place to avoid misuse.
 

You are responsible for the misuse of any scripts on your website.

 

Restrictions on Sending Mail from our Servers

To prevent spam from being sent through our webservers, there are certain restrictions in place when sending email from web scripts. These restrictions help us prevent spammers from using our servers and improves the service we can provide to you.

  • Email must be sent to, or from, an email address hosted by DNN4Less. This must be an existing mailbox in your account, and if your domain’s MX record points to another email provider, it will not count as being hosted by DNN4Less.

  • All outbound email must be routed through our outgoing email servers or it will not be delivered. It is not possible to send email from a script directly to a third party SMTP server.

  • We limit the number of emails you can send in any thirty second period and any ten minute period.

Outgoing mail servers

All mail scripts running on our webservers should use smtp-out.promailbox.net as the outgoing mail server. Please consult the documentation for your scripting language or component to find out how to set this correctly.

ASP Components

Your ASP code can use any of the following components:

PHP

Use the PHP mail function and set the ‘mail from’ value using the following code - replacing email@yourdomain.com with the appropriate email address.

$email_from = “email@yourdomain.com”;
ini_set("sendmail_from", “$email_from");

You need to add a fifth “-f” parameter to the sendmail function. This will set the name of the from address.

mail($email_to, $email_subject, $email_message, $headers, ‘-f’.$email_from);

Tips on securing your mail script

Form-to-mail scripts allow your visitors to fill out a form on your website, which will then email their input to you.

Such forms are regularly used by spammers, who hijack your script to send unsolicited email. Through a few simple checks, you can ensure that your form to mail script is only used by your website and sends to the email address you choose.

 

You can secure your form to mail scripts by checking the referrer string of the page calling your script, before processing it.

(1 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).