Solved

email program

Posted on 2004-04-23
6
181 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
groupSum5 challenge 5 84
MS Access Search and Replace Using VBA 6 72
IF ELSE Statement in Excel Macro VBA 16 64
Export Data to Different .csv Files 26 105
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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.
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…

777 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