How can I send email using vb6 source code?

Asked By 60 points N/A Posted on -
qa-featured

Hi

I am beginner in software development and I need to develop a system in Visual Basic 6 for my project. I need to know how to send an email using vb6 source code?

Thank you

SHARE
Best Answer by Ramonag jenniferf
Answered By 0 points N/A #139370

How can I send email using vb6 source code?

qa-featured

Please follow the below instructions in order to send an email via Gmail using Visual Basic 6 software.

1. Open the Visual Basic program on your PC through programs menu and start a new project from the application.

2. Then within the program switch to "code" view through "view" menu which can be seen on the top menu.

3. After switching enter the following codes to the page in order to create the VB project. Enter your own values at the "GMAIL" and "Password" fields within the codes. The dot lines below represent your data values where you should enter our own project values. Enter values within inverted commas.

"Sub SendGmail()

Set emailMsg = CreateObject("CDO.Message")

Set config = CreateObject("CDO.Configuration")

Set emailFields = config.Fields

sch= " http://schemas.microsoft.com/error.aspx?aspxerrorpath=/library/ms123402.aspx "

emailFields.Item(sch & "sendusing") = 2

emailFields.Item(sch & "smtpserver") = "smtp.gmail.com"

emailFields.Item(sch & "smtpserverport") = 465

emailFields.Item(sch & "smtpauthenticate") = 1

emailFields.Item(sch & "sendusername") = ………………..

emailFields.Item(sch & "sendpassword") = ………………

emailFields.Item(sch & "smtpusessl") = 1

emailsFields.Update

With emailMsg

.To = ………………………………..

.From =………………………….

.Subject = ……………………….

.HTMLBody = ………………….

Set .Configuration = config

.Send

End With

 

Best Answer
Best Answer
Answered By 0 points N/A #139371

How can I send email using vb6 source code?

qa-featured

First thing you have to do is to create your user interface, then next generate codes or write your program codes as follows

Then save it as a text, then now open your source code on visual basic then import you type program code on it then debug. After debugging and no error is found, now you may now compile it to an executable file then run after which,.

I hope the following codes will help you.

Related Questions