Solved

email program

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

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 51

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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone 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

There is an easy way, in .NET, to centralize the treatment of all unexpected errors. First of all, instead of launching the application directly in a Form, you need first to write a Sub called Main, in a module. Then, set the Startup Object to th…
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 video teaches viewers about errors in exception handling.
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…

730 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