SMTP Email: Difference between revisions

57 bytes removed ,  20 November 2007
no edit summary
No edit summary
No edit summary
Line 1: Line 1:
'''Creating a Com Interface for SMTP Email'''
=='''Creating a Com Interface for SMTP Email'''==


'''''Why SMTP?'''''
'''''Why SMTP?'''''
Line 25: Line 25:


Create a simple one-view test application.  On the view you will need the following form controls and name the form objects as indicated:
Create a simple one-view test application.  On the view you will need the following form controls and name the form objects as indicated:
· The SMTP host address - oHost
· The SMTP host address - oHost
· From address - oFromAddr
· From address - oFromAddr
Line 34: Line 35:
In addition, take the following steps
In addition, take the following steps


1. Add “Use aspemail.pkg” to the top of your code, outside the view itself
# Add “Use aspemail.pkg” to the top of your code, outside the view itself
2. Add one button to the view and change the label to “Send”
# Add one button to the view and change the label to “Send”
3. Add the following object to the top of the view, anywhere inside or outside of the view itself:
# Add the following object to the top of the view, anywhere inside or outside of the view itself:


     Object oComMailSender is a cComMailSender
     Object oComMailSender is a cComMailSender
     End_Object
     End_Object


4. We need to create the object
# We need to create the object


     Send CreateComObject to oComMailSender
     Send CreateComObject to oComMailSender
Line 57: Line 58:
Inside the OnClick event in the “Send” button added above, add the following code:
Inside the OnClick event in the “Send” button added above, add the following code:


            String sAttach sName
        String sAttach sName
Integer iRC
Integer iRC
            Set ComUserName of oComMailSender to "YourEmailLoginID"
        Set ComUserName of oComMailSender to "YourEmailLoginID"
            Set ComPassword of oComMailSender to "YourEmailLoginPassword"
        Set ComPassword of oComMailSender to "YourEmailLoginPassword"
            Set ComHost of oComMailSender to (Value(oHost))
        Set ComHost of oComMailSender to (Value(oHost))
            Set ComFrom of oComMailSender to (Value(oFromAddr))
        Set ComFrom of oComMailSender to (Value(oFromAddr))
            Set ComSubject of oComMailSender to (Value(oSubject))
        Set ComSubject of oComMailSender to (Value(oSubject))
            Set ComBody of oComMailSender to (Value(oMessage))
        Set ComBody of oComMailSender to (Value(oMessage))
            Send ComAddAddress to oComMailSender (Value(oToAddr))  sName
        Send ComAddAddress to oComMailSender (Value(oToAddr))  sName
            Get Value of oAttachment to sAttach
        Get Value of oAttachment to sAttach
            If (trim(sAttach) <> "") Begin  
        If (trim(sAttach) <> "") Begin  
                Send ComAddAttachment to oComMailSender sAttach
            Send ComAddAttachment to oComMailSender sAttach
            End
        End
              
              
            Get ComSend of oComMailSender "" to iRC
        Get ComSend of oComMailSender "" to iRC


'''''SMTP Host'''''
'''''SMTP Host'''''


To determine who your SMTP host is, do the following
To determine who your SMTP host is, do the following
1. Bring up your mail client.  For Outlook or Outlook Express…
# Bring up your mail client.  For Outlook or Outlook Express…
2. Click on Tools
# Click on Tools
3. Click Accounts
# Click Accounts
4. Select the account for your provider
# Select the account for your provider
5. Click Properties
# Click Properties
6. On the “Server” tab use the entry from “Outgoing mail (SMTP)”
# On the “Server” tab use the entry from “Outgoing mail (SMTP)”


'''''Operation'''''
'''''Operation'''''
40

edits