Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Dim inString As String
Sub SendMail(mailServer as string, mailTo as String, mailFrom as String, mailSubject as String, mailBody as String)
Dim Dummy As String
Winsock1.Close
Winsock1.Connect mailServer, 25 'SMTP port
Do
DoEvents
Loop Until Winsock1.State = 7 'may wanna add timeout code here
Dummy = GetData() 'wait for standard hello message
Winsock1.SendData "HELO " & Winsock1.LocalIP & vbLf
Dummy = GetData() 'send the RSET code (to send the message correctly)
Winsock1.SendData "RSET" & vbLf
Dummy = GetData()
Winsock1.SendData "MAIL FROM:" & mailFrom & vbLf
Dummy = GetData()
Winsock1.SendData "RCPT TO:<" & mailTo & ">" & vbLf
Dummy = GetData()
Winsock1.SendData "DATA" & vbLf
Dummy = GetData()
Winsock1.SendData "Subject: " & mailSubject & vbLf
Winsock1.SendData Replace(mailBody, vbCrlf, vbLf) & vbLf & "." & vbCrLf
Dummy = GetData()
Winsock1.SendData "QUIT"
Dummy = GetData 'connection is now closed
End Sub
Function GetData() As String
inString = ""
Do
DoEvents
Loop Until inString > ""
GetData = inString
End Function
Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Winsock1.GetData inString
End Sub