Can anyone please look at the next code and tell me what I am doing wrong. I want to add our company logo to the mail.
Code:
CompanyInfo.CALCFIELDS(Picture);
IF CompanyInfo.Picture.HASVALUE THEN BEGIN
CompanyLogo.INIT;
CompanyLogo.GET;
CompanyLogo.Blob := CompanyInfo.Picture;
CompanyLogo.INSERT;
FileLogo := FileManagement.BLOBExport(CompanyLogo,'Signature.jpg',FALSE);
END;
pBodyBlob.Blob.CREATEOUTSTREAM(BodyStream);
BodyStream.WRITETEXT(STRSUBSTNO('%1 ',Text_Dear) + pCustomer.Name);
BodyStream.WRITETEXT('<br><br>');
BodyStream.WRITETEXT(STRSUBSTNO('%1 ',Text_Body));
BodyStream.WRITETEXT('<br><br>');
BodyStream.WRITETEXT(STRSUBSTNO('%1',Test_Regards));
BodyStream.WRITETEXT('<br>');
BodyStream.WRITETEXT('Mohamed Zayed');
BodyStream.WRITETEXT('<br><br>');
BodyStream.WRITETEXT('BA.Service GmbH');
BodyStream.WRITETEXT('<br><br>');
BodyStream.WRITETEXT('<br><br>');
BodyStream.WRITETEXT('<br><br>');
BodyStream.WRITETEXT('<br><br>');
BodyStream.WRITETEXT('<IMG style='HEIGHT: 153px; WIDTH: 445px' src='file:///'+ FileLogo +'''+ 'width=100 height=100>'); // here is the problem
BodyStream.WRITETEXT('<br><br>');
BodyStream.WRITETEXT('<br><br>');
BodyStream.WRITETEXT(STRSUBSTNO('%1',Text_SystemMail));
Results:
Image cant be displayed ---> Donot know why
Answers
My mistake was that my record 'CompanyInof' was of type TEMP
Any idea how can i send this mail to someone else and still the Pic will be correctly displayed
Thanks for your answer, can you be more specific please with some steps ?
BodyStream.WRITETEXT('<IMG src='http://www.companysite.com/logo.png' width=100 height=100>');
you are also defining width and height twice in your img tag
or use the logo that already is on the website of your company.