Solved

email program

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

Expert Comment

by:Ryan Chong
Comment Utility
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
Comment Utility
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 49

Accepted Solution

by:
Ryan Chong earned 125 total points
Comment Utility
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
Comment Utility
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…

763 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now