09-29-2004, 07:32 PM
This simple function uses aspSmartMail component (attached) to send email. Create new function and name it eg "SendEmail4".
[color=green];/[/color]
[color=blue]function [/color]$smtp_server $from $to $subject $text [$files]
[color=green];files: list of attachments, eg "$desktop$\file1.txt[]$desktop$\file2.txt"[/color]
[color=green];EXAMPLE
;SendEmail4 "mail.myhost.com" "[email protected]" "[email protected]" "Hello!" "Some[]text"[/color]
[color=blue]typelib [/color]aspSmartMail "aspSmartMail.dll"
aspSmartMail.SmartMail m._create
m.Server=smtp_server
m.SenderAddress=from
m.Recipients.Add(to)
m.Subject=subject
m.Body=text
[color=blue]str [/color]s
[color=blue]foreach[/color](s files) m.Attachments.Add(s.expandpath)
m.SendMail