PDA

Click to See Complete Forum and Search --> : Email with winsock


xstopx81
Aug 30th, 2000, 04:12 PM
i'm trying to make an email program with winsock... I could send emails with it but for somereason, Font options doesn't work; such as fontcolor, bold, underline... for example, if i have bolding lettering in my text box, if i send it, it shows as no bold letters to the recipients. I would also like to know how to attach files with winsock.. thanks

REM
Aug 30th, 2000, 05:11 PM
When you send the data via winsock, if u want it to be recognised by the reciever in outlook ot hotmail as 'bold', then i think you will have to send the data in HTML format:

Instead of sending this:

This is some BOLD text.


...send this:

This is some <B>BOLDd</B> text


I hope you know what I mean. The data should then be recognised by programs such as outlook or when you're in hotmail.

On the subject of attatching files to messages, i would also like to know how to do this (Winsock API). There is an example on VB Square that shows how to attatch files to messages (uses Base 64 encoding), but it uses the winsock control, and i really haven't got time to look into it (too engrossed in C++ :D). Anyway, i hope this helps :)

Later

REM

xstopx81
Aug 30th, 2000, 05:55 PM
thanks for replying... I iddnt quite catch what you were saying... do i have to state some words are bold or somewords are underlined manually? is there a way where i can just send the text as how it is... without telling winsock each details? thanks again for replying

REM
Aug 30th, 2000, 06:14 PM
It's OK. Let me explain.

When you send data via SMTP, you send raw data in ASCII format. Now it sounds like you are trying to send text from a rich text box as your email body. When u send the data, it will NOT send the formatting with it.

When you read an email in Outlook or hotmail, you have the option to enable HTML code in the email body. This means, that if the raw ascii data in the email body contains HTML tags, it will display them as they would look in a browser, otherwise it will just display the ascii text.

I hope you know what i mean.

Anyway, to send formatted text, u will need to find a way of encoding the data from the rich text box into HTML format, for example, as said earlier:

"This is some BOLD text", would become "This is some <B>BOLD</B> text". This can be repeated for other tags such as underline and strikethrough, font sizer etc etc image urls hyperlkinks...

Understand?

Post back if not giving more information :D

Later

REM

xstopx81
Aug 31st, 2000, 05:47 PM
sorry for reposting again... so to send formatted text, I will need to find a way of encoding the data from the rich text box into HTML format, right? now how do I do that?