VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Text & HTML Version Email Sending, based on Contest Winner.. WinSock/SMTP

Rabid Nerd Productions  (4 Submissions)   Internet/HTML   Visual Basic 3.0   Intermediate   Wed 3rd February 2021

NOTE TO VB5 USERS: Replace is used and would need

to be translated using Replace 'Replacements'

here at VBC...


This code is based on code by: Brian Anderson,

vbcoders.com Winner for Simple Mail

Testing Program

https://www.vbcoders.com/xq/ASP/txtCodeId.841/lngWId.1/qx/vb/scripts/ShowCode.htm



That">https://www.vbcoders.com/xq/ASP/txtCodeId.841/lngWId.1/qx/vb/scripts/ShowCode.htm">https://www.vbcoders.com/xq/ASP/txtCodeId.841/lngWId.1/qx/vb/scripts/ShowCode.htm



That said, I have improved on that framework by

adding OPTIONAL Multipart/Alternative sending

capability. Simple Class File enables event-

driven status monitoring and can handle sending

multiple emails simultaneously.. (Suggested

limit 5 since it is not multi-threaded!)


Code is commented to try to explain as much as

possible, and comments/questions will be

answered


This code was a potential candidate for a

product that sends email to over 1 Million

people on a list, but adequate speeds could not

be reached. Highest clocked speed with a local

(intranet) SMTP server was over 9000/hour,

including going through a SQL table and sending

to unique emails (SQL parts removed)


Enables you to see the SMTP protocol if you mess

around with it.. Example (REALLY SIMPLE)

interface included..


Since it was intended for high-speed outgoing

mail with web-referenced images, file

attachments was not implemented... May do so if

requested enough...


Multipart/Alternative Means that you send TWO

versions of the email to the same person within

one email.. If they have a reader capable of

reading HTML, they will see the HTML. If they

have a text-only mail reader, they will see the

text version instead..

I would have posted BOTH Source and Sample

ZIP, but as many of you know, VBC does not allow

that!


I have uploaded the sample project to:

https://7-10.com/HerbMail.zip



Please">https://7-10.com/HerbMail.zip">https://7-10.com/HerbMail.zip



Please vote for me, and if you do, please also

vote for the author of the code that this was

based on, Brian Anderson (see above)!!!

Inputs
Add the Class (.cls) File and Module (.bas) File to your project and add the references documented in the Class file: 'In the Declarations In a FORM: Public WithEvents Herb as clsHerbSMTP 'In the Form_Load Sub: Set Herb = New clsHerbSMTP Herb.Attach Me ' ' Form that you attach this to also requires a WinSock Control Named HerbSock, and the Index Property MUST BE SET TO 0! Remember to set the Server Variable before sending..

Assumes
Can be a good tutorial for those with Basic VB Knowledge. Beginners may want to look at tutorials about Class Files, WithEvents, and loading an array of controls 'on the fly' (Load HerbSock(NewSock)).

Returns
Returns Current status messages to calling form and fires StatusChange events.

API Declarations
'''SEE BELOW'''

Rate Text & HTML Version Email Sending, based on Contest Winner.. WinSock/SMTP (4(4 Vote))
Text & HTML Version Email Sending, based on Contest Winner.. WinSock/SMTP.bas

Text & HTML Version Email Sending, based on Contest Winner.. WinSock/SMTP Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters