Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I'm sorry, but... 1

Status
Not open for further replies.

briggsy79

Programmer
Feb 23, 2001
68
SE
How can i send an email to myself (bug reports) from a program i have distributed? I would rather do it without outlook, the message would always have the same recipients, and never atachements.
I know this questiuon has been asked a bit, but i have failed to find any answers that satisfy my needs.
Thanks a heap i advance.
 
If you do not mind using a third party dll then there is a nice one called AspEmail. Its basic functionality is free (Does not expire)and would likely cover everything that you require. I have used it for a couple years now to email run-time errors and other application details to my home email address, and have never had a problem with it. Works well and is easily implemented in VB applications.

If interested the Link:
 
Although kevinclark's solution looks to be easier and more reliable, if you don't want to use the dll or maybe want to receive mail as well, I found this to be helpful - Its a set of classes that just use the MS Winsock control for sending and receiving email. Pretty easy to use, however I found I needed to add a Date header when sending or some recipients received blank Subject and Return Address lines. Other than that, I've been sending and receiving literally hundreds of emails a day (**not spamming**) with these classes with no trouble.
 
I haven't checked out that pscode.com link, but its probably what I'm about to suggest. Learn the SMTP (Simple Mail Transfer Protocol). This is the protocol used to send mail, and POP3 is used to receive. SMTP is dead easy, and is very simple to implement via winsock.

 
Thanks for all the help.
I have been testing the aspemail dll and it seems to work fine.
My only question is; is there any way I can find the address of the smpt server of the user. As prompting the user for their smpt server address eems a bit tedious.
Thanks again
 
There may be a way capture the SMTP Server but unfortunately I am not aware of it. Typically I have my app prompt the user for their email settings and then write the info to an INI file or to the registry.

-----------------------------------------------------------Sample INI File example: MyAppName.ini

[MAIL SETTINGS]
Enabled=False
Port =25
Host =smtp1.yahoo.com
From=optional@useraddress.com
Subject=Optional Subject line
Comment=Optional Comment Line


----------------------------------------------------------
Sample VB Code

‘API’s used for reading and writing to INI Files


Public Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lpFileName As String) As Long
Public Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
Public Declare Function GetPrivateProfileInt Lib "kernel32" Alias "GetPrivateProfileIntA" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal nDefault As Long, ByVal lpFileName As String) As Long


Public MyIni as String
Public SMTPPort as Integer
Public SMTPHost as String


Private Sub Read_Ini_Sample()
Dim Temp As String * 300
Dim ReadLine As Integer
Dim HelpDocument As String

MyINI = App.Path & "\ MyAppName.ini "

ReadLine = GetPrivateProfileString("EMAIL SETTINGS", _
“Port", 25, Temp, Len(Temp), MyINI)
SMTPPort = Cint(Left$(Temp, Len(Temp)))

ReadLine = GetPrivateProfileString("EMAIL SETTINGS", _
“Host", “NOT FOUND”, Temp, Len(Temp), MyINI)
SMTPHost = Left$(Temp, Len(Temp))

End Sub

Private Sub Write_Ini_Sample()
Dim WriteLine As Integer

SMTPHost = InputBox(“Please enter name of your SMTP Host”)
WriteLine = WritePrivateProfileString("EMAIL SETTINGS", _
"Host", SMTPHost, MyINI)

End Sub
 
Well, if any of you who are familar with ASPEmail still out there, are you familiar with Logon process in MailSender module at all? It's all of a sudden bombing after the system password change. I thought I changed all the password accordingly in IIS and COM+, but still not working. Where should I look?

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top