Solved

Sending Mail

Posted on 2004-04-27
6
225 Views
Last Modified: 2013-11-13
Please provide me the correct steps to be followed to while programming in VB to send a mail
0
Comment
Question by:sreeja
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 1

Accepted Solution

by:
craduza earned 125 total points
ID: 10936243
try this...it's the best..:D
just study the code..coz it's very easy...

http://www.freevbcode.com/ShowCode.Asp?ID=109
0
 
LVL 19

Expert Comment

by:RanjeetRain
ID: 10936324
Do you have any prerequisites? If not, go for the above suggested components. Its one of the best and most used components!
0
 
LVL 1

Assisted Solution

by:elatagaw
elatagaw earned 125 total points
ID: 11066423
try this code by:

'Martin Anbu Selvan
'St.joseph's college of Engineering,chennai.
'tissot_swiss@yahoo.com

'u need -5 combo boxes and 3 textboxes.1 command button,winsock control.

'declaration

const Cr = vbCrLf



Private Sub cmdSend_Click()
txtLog.Text = Empty
Socket.Close
Socket.RemoteHost = txtServer.Text
Socket.RemotePort = 25
Status "Connecting..."
Socket.Connect
End Sub
Public Sub Status(Txt As String)
txtStatus.Text = Txt
End Sub
Private Sub Ssocket_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
Status "Error!"
End Sub
Private Sub Form_Load()
txtServer.AddItem "mta208.mail.scd.yahoo.com"
txtServer.AddItem "mc2.law16.hotmail.com"
End Sub
Private Sub Socket_Connect()
Dim Txt As String
Status "Connected"
Txt = ""
Txt = Txt & "HELO aaa" & Cr
Txt = Txt & "MAIL FROM: <" & txtFromAddress.Text & ">" & Cr
Txt = Txt & "RCPT TO: <" & txtTo.Text & ">" & Cr
Txt = Txt & "DATA" & Cr
Txt = Txt & "From: " & txtFromName.Text & "<" & txtFromAddress.Text & ">" & Cr
Txt = Txt & "Subject: " & txtSubject.Text & Cr
Txt = Txt & txtText.Text & Cr
Txt = Txt & Cr & Cr & "." & Cr
Txt = Txt & Cr & "quit"
Socket.SendData Txt
End Sub

Private Sub Socket_DataArrival(ByVal bytesTotal As Long)
Dim RText As String
Socket.GetData RText, vbString
txtLog.Text = txtLog.Text & RText
End Sub

Private Sub Socket_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
Status "Error!"
End Sub

Private Sub Socket_SendComplete()
Status "Mail Sent."
End Sub

Private Sub Socket_SendProgress(ByVal bytesSent As Long, ByVal bytesRemaining As Long)
Status "Sending mail..."
End Sub

Good Luck!
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Having just graduated from college and entered the workforce, I don’t find myself always using the tools and programs I grew accustomed to over the past four years. However, there is one program I continually find myself reverting back to…R.   So …
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question