VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Very Simple Mail Program using SMTP. Requires you download and reference Dimac's free J Mail compon

by Bhaskar Ganapathe (2 Submissions)
Category: Internet/HTML
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sat 5th August 2000
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Very Simple Mail Program using SMTP. Requires you download and reference Dimac's free J Mail component from https://www.dimac.se

Rate Very Simple Mail Program using SMTP. Requires you download and reference Dimac's free J Mail compon



' Put 5 TextBoxes for From,To,Subject,Attachment,Message
' Put a commondialog control and a command button adjacent to the 
' Attachment Text Box
' and change its caption as Attach...
' Put another Button and change its caption to Send
' Finally copy the code given below to ur form
' Reply to [email protected]
End Sub


Private Sub Command1_Click()
On Error Resume Next
Set Jmail = New SMTPMail


' Change it to ur ServerAddress from where u will send the mails
' Better give the IP address and also give the :25 since the port for smtp is 25
Jmail.ServerAddress = "192.168.10.1:25"

' Change it to ur name as u like here
Jmail.Sender = "Bhaskar"


Jmail.ReplyTo = Text1
Jmail.AddRecipientEx Text2, "<>"
Jmail.Subject = Text4
Jmail.Priority = 1
Jmail.Body = Text3

If Text5 <> "" Then
   Jmail.AddAttachment Text5
End If

Jmail.Execute

If Err <> 0 Then
  MsgBox Error$, vbCritical, "Mail Error"
Else
  MsgBox "Your Mail has been sent to " & Text2
  Unload Me
End If

Set Jmail = Nothing
End Sub

Private Sub Command2_Click()
CommonDialog1.ShowOpen
Text5 = CommonDialog1.FileName
End Sub




Download this snippet    Add to My Saved Code

Very Simple Mail Program using SMTP. Requires you download and reference Dimac's free J Mail compon Comments

No comments have been posted about Very Simple Mail Program using SMTP. Requires you download and reference Dimac's free J Mail compon. Why not be the first to post a comment about Very Simple Mail Program using SMTP. Requires you download and reference Dimac's free J Mail compon.

Post your comment

Subject:
Message:
0/1000 characters