HOME   Work with us   Tell a friend

Network Status: ok | Contacts

Using AspEmail
To use the AspEmail, you must load the object as shown below:

Set Mail = Server.CreateObject("Persits.MailSender")

To send messages, the AspEMail needs an SMTP server:

Mail.Host = "mail-nt.braslink.com"
Mail.Port = 25 ' Optional. Port 25 is the standard port

You can also use a SMTP server list separated by semicolons (;). If a server is down, it will automatically try the next server:

Mail.Host = "mail-nt.braslink.com;mail-nt.braslink.net"

You must specify the sender email:

Mail.From = "sender@yourdomain.com"
Mail.FromName = "Sender name" ' Optional

To add recipients, CCs, BCCs, e Reply-To, use:
AddAddress, AddCC, AddBcc and AddReplyTo respectively.
These options accept two parameters, an email address and an optional name.
For example:

Mail.AddAddress "recipient@yourdomain.com", "Name of recipient"
Mail.AddCC "recipientcc@yourdomain.com" ' The name is optional Use Subject and Body to specify the subject and text of the message respectively. The message text could be sent in HTML format. For example:

Mail.Subject = "E-mail subject"
Mail.Body = "Dear Sir: " & chr(13) & chr(10) &_
"This is a test page

or in HTML format:

Mail.Subject = "E-mail subject"
Mail.Body = "<HTML><BODY BGCOLOR=#0000FF>Dear Sir:....</BODY></HTML>"
Mail.IsHTML = True

To send file attachments, use the AddAttachment option according to the example below:

Mail.AddAttachment server.mappath("./file.doc")

To send the message use the Send method. Use the example below to check for errors:

On Error Resume Next
If Err <> 0 Then
    Response.Write "An error was found: " &_

End If


At the end of the programming above, always use the code:

Set mail=nothing

This makes the object unload from your website and prevents it from being slow.

Complete example:

Set Mail = Server.CreateObject("Persits.MailSender")

Mail.Host = "mail-nt.braslink.com"

Mail.From = "sender@yourdomain.com"
Mail.FromName = "Sender name" ' Optional

Mail.AddAddress recipient

'Uncomment the line below to send emails in HTML format
'Mail.IsHTML = True

Mail.Subject = "Message subject"

Mail.Body = "Message body"

error = ""
success = False
On Error Resume Next 'Check for errors
Mail.Send 'Send message

If Err <> 0 Then
error = Err.Description
success = True
End If
Set Mail = nothing

<% If error <> "" Then%>
There was an error: <% = error %>
<% End If %>

<% If success Then%>
Message sent to <% = recipient %> successfully.
<% End If %>

    Control Panel

    Trought the Control Panel get access to payments, plans exchange and settings for you domain.

  • Your IP:
    Forgot my Password ?

    Help and Support
Privacy |  Security |  SLA |  Help |  DataCenter |  Anti-SPAM |  Contact us | 
Braslink Network Inc.