0

I need to store the image with email signature which can be sent to any email server like gmail,yahoo and etc . For this, I am planning to convert image to base64string first and then make the image tag out of it and store it with image signature body in database. Now wherever user sends the mail, his signature (signature body + image tag) will go with email. This way most of the email clients can display the image inline with signature.

To me this approach looks Ok, but one factor to consider for this, with base 64 string, image body will take lot of space in database column. Would like to know is this good way to go?

M Sach
  • 33,416
  • 76
  • 221
  • 314
  • Just use and HTML formated email and have the Image point to a URL. – dngfng Oct 23 '12 at 06:38
  • 1
    @Andrew Typo mistake. Corrected it – M Sach Oct 23 '12 at 06:41
  • 1
    You could upload that image to any sharehosting server and use that image path in your image tag instead of storing image in DB.If you dont have shared hosting account then you can use any free hosting server to post your image on server that is ofcouse you are ok with putting that image on the internet. – neel.1708 Oct 23 '12 at 06:54

1 Answers1

2

If the image is small enough to send via email, then it is small enough to store in any database as text/binary data. Presumably (hopefully) you only intend to add a single small, reasonably-optimized image that is at most 5-10KB in size.

See also: https://stackoverflow.com/a/9110164/453277 for an alternative method of including an image-based signature.

Community
  • 1
  • 1
Tim M.
  • 53,671
  • 14
  • 120
  • 163
  • I am more inclined with this base 64 approach. Reason is it will be treated consistently whether i send the mail to external system or within my internal system where emails are handled like any typical webapplication Data. With this, user can define the postion of image etc.My Db column nvarchar(sqlserver) support upto 2gb of image. Probably though it wont be practical scenario. I think i can go ahead with this approach. Any suggestions will be appreciated. – M Sach Oct 24 '12 at 11:36