Solved

email program

Posted on 2004-04-23
6
183 Views
Last Modified: 2013-11-13
hi i want to make a program that will email one address all the time i.e. the address is hard coded into the program.i want to be two froms in it and for it to load the second form when the email is sent. Could someone please write the code that will have two text boxes in the first form. one should be the subject and the second should be the main body of the email. I this possible? The reason i want to do this is because my cousin has a dialup pay as u go connection and this would save him a lot of moneyas it would allow him to quickly send emails without having to load a web page. also i need one button to send th message

the only thing i dont get is if the email is sent to me - what address it came from will be on the message?

thanks in advance

the person who gets the points will always get an A grade answer
0
Comment
Question by:shakoor_h
  • 2
6 Comments
 
LVL 50

Expert Comment

by:Ryan Chong
ID: 10901631
Try use this free email component to send email:
http://www.freevbcode.com/ShowCode.Asp?ID=109

Example will be provided if necessary. regards
0
 

Author Comment

by:shakoor_h
ID: 10907909
Th info you gave is far too complex for me and also doesn't work for some reason. an activex component can't create object - Runtime error '429' and has a problem with this specific pece of code:

 Set poSendMail = New clsSendMail

anyone else?
0
 
LVL 50

Accepted Solution

by:
Ryan Chong earned 125 total points
ID: 10908206
I think you need to register the dll provider first.

Try copy the vbSendMail.dll into your System Folder.

then open a Dos Prompt, enter:

regsvr32 vbSendMail.dll

then try your code again, if Not working, try reboot your pc then try again.

regards
0
 
LVL 1

Expert Comment

by:elatagaw
ID: 11066461
try this code from:

'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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
base64 decode encode 12 145
Run code from text file in vb 1 71
vb6 connector to SQL Server 2 37
which modules are active in VB6 project? 6 39
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 explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

808 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