Dear friends,
I am not getting results for sending a documents as attachment in email.
can you help please...
SMTPsetup.GET;
SenderName:=SMTPsetup."Email sender Name";
SenderAddress:=SMTPsetup."Email sender email";
Recipients:=vendorRec."E-Mail"+';'+SMTPsetup."Manager Email";
kSubject:="No."+' PO for '+FORMAT(Amount);
kBody:=' ';
Tofile := Name;
Tofile := "No."+'.pdf';
FileAndPathName := SMTPsetup."Path to Save Report" + Tofile;
FileAndPathName:=CONVERTSTR(FileAndPathName,'\','/');
FileName:=FileAndPathName;
WHILE STRPOS(FileName,'\') > 0 DO
FileName := COPYSTR(FileName, STRPOS(FileName,'\') +1);
CurrPage.SETSELECTIONFILTER(Rec);
REPORT.SAVEASPDF(405, FileName, Rec);
CLEAR(email);
email.CreateMessage(Recipients,'','',kSubject,kBody,FALSE,FALSE);
email.AddBodyline(' Dear Sir/Madam');
email.AddBodyline('<BR><BR>');
email.AddBodyline(' PO Document '+"No."+' '+"Pay-to Name"+' approved ');
email.AddBodyline('<BR><BR>');
email.AddBodyline('Operations');
email.AddBodyline('<BR><BR>');
email.AddBodyline('My Company');
email.AttachFile(FileName);
MESSAGE(FileName);
email.Send;
Pleasee..
kris
I am not getting results for sending a documents as attachment in email.
can you help please...
SMTPsetup.GET;
SenderName:=SMTPsetup."Email sender Name";
SenderAddress:=SMTPsetup."Email sender email";
Recipients:=vendorRec."E-Mail"+';'+SMTPsetup."Manager Email";
kSubject:="No."+' PO for '+FORMAT(Amount);
kBody:=' ';
Tofile := Name;
Tofile := "No."+'.pdf';
FileAndPathName := SMTPsetup."Path to Save Report" + Tofile;
FileAndPathName:=CONVERTSTR(FileAndPathName,'\','/');
FileName:=FileAndPathName;
WHILE STRPOS(FileName,'\') > 0 DO
FileName := COPYSTR(FileName, STRPOS(FileName,'\') +1);
CurrPage.SETSELECTIONFILTER(Rec);
REPORT.SAVEASPDF(405, FileName, Rec);
CLEAR(email);
email.CreateMessage(Recipients,'','',kSubject,kBody,FALSE,FALSE);
email.AddBodyline(' Dear Sir/Madam');
email.AddBodyline('<BR><BR>');
email.AddBodyline(' PO Document '+"No."+' '+"Pay-to Name"+' approved ');
email.AddBodyline('<BR><BR>');
email.AddBodyline('Operations');
email.AddBodyline('<BR><BR>');
email.AddBodyline('My Company');
email.AttachFile(FileName);
MESSAGE(FileName);
email.Send;
Pleasee..
kris