Email attachment (picture) without saving

Happy new year all!
I am working on a facturation app with SQLite.
Once all information completed, I would like to send the Drawn picture (jpeg or PDF, whatever can be done) within the mail or attached directly from the app without saving since I do not need it, information being stored in database.
I thought I could “convert” to a Folderitem and then attache it, but it seems I have a missing link.
Any clue where to find a way to doing it; I am lost in my search.

Thx for your help,


you can use EmailAttachment.Data, set it to a string-value.


In reply to your private mail, perhaps it could help someone else.

Some rough code:

[code] Dim p as New Picture(1000,1000,32)
p.Graphics.ForeColor = RGB(178,188,0)

	Dim socket as new SMTPSecureSocket
	Dim mail As New EmailMessage
	Dim file As new EmailAttachment
	file.Name = "image.jpeg"
	file.ContentEncoding = "BASE64"
	file.Data = EncodeBase64(p.getData(picture.FormatJPEG, 80), 76)
	mail.FromAddress = "xxx"
	mail.Subject = "Testemail"
	mail.BodyPlainText = "Dies ist eine Email"
	mail.BodyHTML = ""
	socket.Address = "xxx" 
	socket.Port = 465 
	socket.ConnectionType = SMTPSecureSocket.TLSv1
	socket.SMTPConnectionMode = SMTPSecureSocket.ModeSSLTLS
	socket.Secure = True 
	socket.Username = "xxx"
	socket.Password = "xxx"


Thank you VERY MUCH Marius.
Worked perfectly.