Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SMTP GATE VIA PROCOMM SCRIPT

Status
Not open for further replies.

FTTPMAN

Technical User
Dec 20, 2007
4
US
Has anyone used Procomm script to send email via an SMTP GATE?
 
I wrote a DLL to allow me to download email to a file so that an ASPECT script could process the email (e.g., remotely send a set of instructions to an ASPECT script via an email) and I intended eventually to work out how to have the script respond via email. Unfortunately, I stopped working on the project some years ago so I don't know the answer.

There are a series of SET/FETCH commands in ASPECT scripting related to email:

mail address string

Specifies the Internet mail address used in the header of outgoing mail. This command corresponds to the Email Address field in the User Info panel of the Setup, Internet, Internet Mail dialog. fetch returns the contents of the Email Address field in a string.

mail forwardaddress OFF | ON | string

Specifies the Internet mail address used to send mail. This entry is only used if outgoing mail must be sent through a different server than incoming incoming mail. This command corresponds to the Forward outgoing... field in the Mail Server panel of the Setup, Internet, Internet Mail dialog. fetch returns the OFF / ON setting in an integer or the server address in a string.

mail logonname string

Specifies the username to be used when connecting to the mail server. This command corresponds to the Logon Name field in the Mail Server panel of the Setup, Internet, Internet Mail dialog. fetch returns the contents of the Logon name field in a string.

mail options index | string

Specifies the active Mail Client options set, corresponding to the Current Mail Options in Setup, Internet, Internet Mail. Either the zero-based index or the name of an option set as it appears in the Current Mail Options list may be used. fetch returns the contents of the Current Mail Options field in a string.

mail password string

Specifies the password to be used when connecting to the mail server. This command corresponds to the Password field in the Mail Server panel of the Setup, Internet, Internet Mail dialog. fetch returns the contents of the Password field in a string.

mail replyaddress string

Specifies the Internet mail address on which you would like to receive replies. When the person you are sending mail to receives your message, this is the address they will see on the Reply to line of their mail reader. This command corresponds to the Reply Address field in the User Info panel of the Setup, Internet, Internet Mail dialog. fetch returns the contents of the Reply Address field in a string.

mail serveraddress string

Specifies the ip address of the mail server from which you receive mail. This command corresponds to the Incoming mail server address field in the User Info panel of the Setup, Internet, Internet Mail dialog. fetch returns the contents of the Incoming mail server address field in a string.

mail signaturefile filespec

Specifies a text file that contains text to be appended to the end of all mail messages you send. This command corresponds to the Signature file field in the User Info panel of the Setup, Internet, Internet Mail dialog. fetch returns the contents of the Signature file field in a string.

mail username string

Specifies the username to be used when sending Internet mail. This command corresponds to the Full name field in the User Info panel of the Setup, Internet, Internet Mail dialog. fetch returns the contents of the Full name field in a string.

I vaguely recall heading in the direction of using Procomm to send an email and controlling a remote Procomm session (in Internet Mail mode) via DDE calls.

You can use pastetext, cliptostr and strtoclip to copy strings to/from the clipboard. And you can issue a DDE command to a remote Procomm session to paste the clipboard.

Eventually I'll write my own SMTP wrapper in a DLL so that my application can access POP3/SMTP directly. It'll be useful for sending HTML formatted status reports.



If you figure it out, let me know, I am starting to review my old code library again in the hopes of completing earlier projects.
 
By SMTP gate, do you mean you are wanting to send via an actual SMTP connection? If not, there are methods to send an email via Procomm that are easier. You can "drive" Procomm's interface to send an email using its mail client. You could do the same with another mail program, such as Outlook. If you have a MAPI-compliant mail reader like Outlook, you can have a script that sends through that interface, although I did not have any luck with newer versions of Outlook the last time I tried for some reason.

 
Yes - by SMTP gate. Our company uses Outlook 2003 for mail service and as you probably have run into, it always requires manual intervention to actually send the email -informing the user that ANOTHER APPLICATION IS ATTEMPTING TO SEND AN EMAIL ON YOUR BEHALF when using the MAPI feature. Our IT will not disable this feature in Outlook and suggested that I use the SMTP GATE to send emails.

I haven't had time to get back to this due to other script requests that have a higher priority but hope to do so next week.

 
Thanks Knob... I had heard of that utility, but would like to try and figure some way around that. If I come up with something, I will post it here.
 
I've been doing some playing with the ASPECT telnet interface and I re-discovered (I had forgotten I knew this) that you can use the Telnet interface to connect to POP3 (Telnet to port 110) and SMTP (Telnet to port 25).

Provided that you wrote a script to process email, it would be possible to do all sorts of automation tasks that could receive and/or send email using Procomm.

The script command to connect with telnet is:

Code:
connect telnet "entry name"

or

Code:
proc main
   dial DATA "Symantec"   ; Dial Symantec entry.
   while $DIALING          ; Loop while dialing.
   endwhile
   if $CARRIER             ; See if we're connected.
      transmit "Hello?"    ; Send a string to say hello.
      hangup               ; Hang up the phone line.
   else
      errormsg "Sorry, not connected."
   endif
endproc

Unfortunately, since POP3 and SMTP use ports different than telnet, you cannot use connectmanual to specify the connection on the fly, you have to build an entry.

You could conceivably use dialadd/dialdelete to generate and remove the entries to simulate dynamic dialing... but it would still only be a simulation.

To make this work though, you would need to have a pretty intimate understanding of how SMTP/POP3 worked at the server/client interface level.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top