http://foro.elhacker.net/programacion_vb/tutorial_enviando_email_con_vb6-t230043.0.html
Código:
'---------------------------------------------------------------------------------------
' Module : mInternetOpenAlter
' DateTime : 03/10/2008 23:11
' Author : Cobein
' Mail : cobein27@hotmail.com
' WebPage : http://www.advancevb.com.ar
' Member of : http://hackhound.org/
' Purpose : Do an URL request, usefull to send information.
' Usage : At your own risk
' Requirements: None
' Distribution: You can freely use this code in your own
' applications, but you may not reproduce
' or publish this code on any web site,
' online service, or distribute as source
' on any media without express permission.
'
' Reference : Inspired by an article from ErMoja
'
' History : 03/10/2008 First Cut....................................................
'---------------------------------------------------------------------------------------
'
'// Sample PHP
'<?php
'$val = $_GET['value'];
'mail ('myemail@hotmail.com', 'Title', $val);
?>
'
'// Sample Call
'Private Sub Form_Load()
' InternetOpenAlter "http://www.myserver.com.ar/mailme.php?value=Test"
'End Sub
'---------------------------------------------------------------------------------------
Option Explicit
Private Declare Sub RtlMoveMemory Lib "kernel32" (pDst As Any, pSrc As Any, ByVal dlen As Long)
Private Declare Function CallWindowProcA Lib "user32" (ByVal adr As Long, ByVal p1 As Long, ByVal p2 As Long, ByVal p3 As Long, ByVal p4 As Long) As Long
Private Declare Function GetProcAddress Lib "kernel32" (ByVal hModule As Long, ByVal lpProcName As String) As Long
Private Declare Function LoadLibraryA Lib "kernel32" (ByVal lpLibFileName As String) As Long
Public Function InternetOpenAlter(ByVal sUrl As String) As Boolean
Dim lLib As Long
Dim lhConn As Long
Dim lhFile As Long
Dim bvASM(255) As Byte
Dim vItem As Variant
Dim lPos As Long
Dim lPtr As Long
Dim lMod As Long
For Each vItem In Array( _
&H58, &H59, &H59, &H59, &H59, &H50, &H68, &H0, &H0, &H0, &H0, &H68, &H0, &H0, &H0, &H0, _
&H68, &H0, &H0, &H0, &H0, &H68, &H1, &H0, &H0, &H0, &H68, &H0, &H0, &H0, &H0, &HE8, _
&H0, &H0, &H0, &H0, &HC3, &H58, &H59, &H59, &H59, &H59, &H50, &H68, &H0, &H0, &H0, &H0, _
&H68, &H0, &H0, &H0, &H80, &H68, &H0, &H0, &H0, &H0, &H68, &H0, &H0, &H0, &H0, &H68, _
&H0, &H0, &H0, &H0, &H68, &H0, &H0, &H0, &H0, &HE8, &H0, &H0, &H0, &H0, &HC3, &H58, _
&H59, &H59, &H59, &H59, &H50, &H68, &H0, &H0, &H0, &H0, &HE8, &H0, &H0, &H0, &H0, &HC3, _
&H58, &H59, &H59, &H59, &H59, &H50, &H68, &H0, &H0, &H0, &H0, &HE8, &H0, &H0, &H0, &H0, &HC3)
bvASM(lPos) = vItem: lPos = lPos + 1
Next
lPtr = VarPtr(bvASM(0))
lLib = LoadLibraryA("wininet")
lMod = GetProcAddress(lLib, "InternetOpenW")
RtlMoveMemory ByVal lPtr + 32, lMod - lPtr - 36, &H4
lMod = GetProcAddress(lLib, "InternetOpenUrlW")
RtlMoveMemory ByVal lPtr + 74, lMod - lPtr - 78, &H4
lMod = GetProcAddress(lLib, "InternetCloseHandle")
RtlMoveMemory ByVal lPtr + 91, lMod - lPtr - 95, &H4
RtlMoveMemory ByVal lPtr + 108, lMod - lPtr - 112, &H4
lhConn = CallWindowProcA(VarPtr(bvASM(0)), 0, 0, 0, 0)
If Not lhConn = 0 Then
RtlMoveMemory ByVal lPtr + 69, lhConn, &H4
RtlMoveMemory ByVal lPtr + 64, StrPtr(sUrl), &H4
lhFile = CallWindowProcA(VarPtr(bvASM(37)), 0, 0, 0, 0)
If Not lhFile = 0 Then
RtlMoveMemory ByVal lPtr + 86, lhFile, &H4
Call CallWindowProcA(VarPtr(bvASM(79)), 0, 0, 0, 0)
InternetOpenAlter = True
End If
RtlMoveMemory ByVal lPtr + 103, lhConn, &H4
Call CallWindowProcA(VarPtr(bvASM(96)), 0, 0, 0, 0)
End If
End Function