Solved

email program

Posted on 2004-04-23
6
186 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
[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
  • 2
6 Comments
 
LVL 52

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 52

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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

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.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

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