With version 9.0.1 build 293382 I get this output:
#!perl
use Win32::OLE;
sub fnSendEmail {
my $myMail;
# Create an object of CDO type
$myMail = Win32::OLE->new('CDO.Message');
# Enable SSL Authentication
$myMail->Configuration->Fields->SetProperty("Item", 'http://schemas.microsoft.com/cdo/configuration/smtpusessl', 1);
# Enable basic smtp authentication
$myMail->Configuration->Fields->SetProperty("Item", 'http://schemas.microsoft.com/cdo/configuration/smtpauthenticate', 1);
# Specify Yahoo SMTP server and Port Number
$myMail->Configuration->Fields->SetProperty("Item", 'http://schemas.microsoft.com/cdo/configuration/smtpserver', 'smtp.mail.yahoo.com');
$myMail->Configuration->Fields->SetProperty("Item", 'http://schemas.microsoft.com/cdo/configuration/smtpserverport', 465);
$myMail->Configuration->Fields->SetProperty("Item", 'http://schemas.microsoft.com/cdo/configuration/sendusing', 2);
# Specify user id and password
$myMail->Configuration->Fields->SetProperty("Item", 'http://schemas.microsoft.com/cdo/configuration/sendusername', 'sen...@yahoo.com');
$myMail->Configuration->Fields->SetProperty("Item", 'http://schemas.microsoft.com/cdo/configuration/sendpassword', '**********');
# Update the configuration fields
$myMail->Configuration->Fields->Update();
# Specify email properties
$myMail->{Subject} = 'Sending Email from QTP';
$myMail->{From} = 'sen...@yahoo.com';
$myMail->{To} = 'phi...@insight.rr.com';
$myMail->{CC} = '';
$myMail->{BCC} = '';
$myMail->{TextBody} = 'This is the Text Body';
# Send 2 attachments in the mail
$myMail->AddAttachment('D:\\Attachment1.txt');
$myMail->AddAttachment('D:\\Attachment2.txt');
# Send mail
$myMail->Send();
$myMail = undef;
}
// Eric
On 3/24/2012 10:04 PM, Phillip Richcreek wrote:
> Function fnSendEmail()> 'Create an object of CDO type> Set myMail=CreateObject("CDO.Message")> 'Enable SSL Authentication> myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl")> = True> 'Enable basic smtp authentication> myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate")> = 1> 'Specify Yahoo SMTP server and Port Number> myMail.Configuration.Fields.Item> ("http://schemas.microsoft.com/cdo/configuration/smtpserver")="smtp.mail.yahoo.com"> myMail.Configuration.Fields.Item> ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") => 465> myMail.Configuration.Fields.Item> ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2> 'Specify user id and password> myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername")> ="send...@yahoo.com"> myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword")> = "**********"> 'Update the configuration fields> myMail.Configuration.Fields.Update> 'Specify email properties> myMail.Subject = "Sending Email from QTP"> myMail.From ="send...@yahoo.com"> myMail.To ="phil...@insight.rr.com"> myMail.CC = ""> myMail.BCC = ""> myMail.TextBody = "This is the Text Body"> 'Send 2 attachments in the mail> myMail.AddAttachment "D:\Attachment1.txt"> myMail.AddAttachment "D:\Attachment2.txt"> 'Send mail> myMail.Send> Set myMail = Nothing> End Function
_______________________________________________
PDK mailing list
P...@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs