VB icon

Send EMAIL your local machine with/without SMTP

Email
Submitted on: 2/9/2015 6:30:00 PM
By: B.Cem HANER (from psc cd)  
Level: Intermediate
User Rating: By 5 Users
Compatibility: VB 4.0 (32-bit), VB 5.0, VB 6.0
Views: 1539
 
     Send your emails without SMTP email server on your local machine. You cand create email list and send emails your list ! Easy & powerful ! Thanx for votes..

 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
				
'**************************************
' Name: Send EMAIL your local machine with/without SMTP
' Description:Send your emails without SMTP email server on your local machine. You cand create email list and send emails your list ! Easy & powerful !
Thanx for votes..
' By: B.Cem HANER (from psc cd)
'
' Inputs:Microsoft CDO for Windows 2000 (XP,2000,2003)
'**************************************

You must add tis reference your project:
Microsoft CDO for Windows 2000 (XP,2000,2003)
Insert this code Command1_Click event. And run !
Ok john. Please dont worry and don't 
hate :) If you are using SMTP server 
please add this lines.. Goog luck 
!
If you are using SMTP server please add this lines your code.
'------------------
Mail.Configuration.Fields.Item("smtpserver") = "smtp.yourserver.com"
Mail.Configuration.Fields.Item("smtpserverport") = 25
Mail.Configuration.Fields.Update
------ STANDART TEXT MESSAGE SEND -----------
Dim Mail As CDO.Message
Set Mail = New CDO.Message
Mail.From = "yourmailORother@mail.com"
Mail.To = "alexis@mail.com"
Mail.Subject = "Your subject"
Mail.TextBody = "MySubject"
Mail.Send
:) OK Your mail is sent !
------ USING CC & BCC FIELDS ------------
Dim Mail As CDO.Message
Set Mail = New CDO.Message
Mail.Subject="Sending email with CDO"
Mail.From="mymail@mydomain.com"
Mail.To="someone@somedomain.com"
Mail.Bcc="someoneelse@somedomain.com"
Mail.Cc="someoneelse2@somedomain.com"
Mail.TextBody="This is a message."
Mail.Send
------ SENDING HTML TYPED MAIL ------------
Dim Mail As CDO.Message
Set Mail = New CDO.Message
Mail.Subject="Sending email with CDO"
Mail.From="mymail@mydomain.com"
Mail.To="someone@somedomain.com"
Mail.HTMLBody = "<h1>This is a message.</h1>" 
Mail.Send
------ SENDING HTML MAIL FROM WEB PAGE ----------
Dim Mail As CDO.Message
Set Mail = New CDO.Message
Mail.Subject="Sending email with CDO"
Mail.From="mymail@mydomain.com"
Mail.To="someone@somedomain.com"
Mail.CreateMHTMLBody "http://www.w3schools.com/asp/" 
Mail.Send
%> 
------ SENDING HTML MAIL FROM WEB PAGE ----------
Dim Mail As CDO.Message
Set Mail = New CDO.Message
Mail=CreateObject("CDO.Message")
Mail.Subject="Sending email with CDO"
Mail.From="mymail@mydomain.com"
Mail.To="someone@somedomain.com"
Mail.CreateMHTMLBody "c:\webs\test.htm" 
Mail.Send
------ SENDING MAIL WITH ATTACHMENT OPTION -----
Dim Mail As CDO.Message
Set Mail = New CDO.Message
Mail.Subject="Sending email with CDO"
Mail.From="mymail@mydomain.com"
Mail.To="someone@somedomain.com"
Mail.TextBody="This is a message."
Mail.AddAttachment "c:\mydocuments\test.txt"
Mail.Send


Other 7 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

8/13/2015 11:07:18 AMgrt

but it really workz without an smtp server?
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.