|
-
Sep 6th, 2007, 03:07 AM
#1
Thread Starter
Banned
Emailing in VB6?
I had a friend, he could send me an email from an email he doesn't have. (ex: [email protected] or anything else.) He could send me any email too. He showed me the program, and let me use it, it was made in vb, but he would never give me the source. How Can I do this with vb6?
-
Sep 6th, 2007, 03:26 AM
#2
Re: Emailing in VB6?
i get enough spam already thanx
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Sep 6th, 2007, 04:00 AM
#3
Thread Starter
Banned
Re: Emailing in VB6?
Very helpful comment. This isn't for spam.
-
Sep 6th, 2007, 09:52 AM
#4
Lively Member
Re: Emailing in VB6?
If you have a mail server using exchange you could add a reference to:'Microsoft CDO for exchange' then use this code ?
Code:
Private Sub Command1_Click() 'send Email
Dim objMessage
On Error GoTo err:
Set objMessage = New CDO.Message
objMessage.Subject = "Test Message"
objMessage.From = "from.me.com" 'add any text here
objMessage.To = "to_your.friend.com"
objMessage.TextBody = "This is a test message"
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "192.168.26.1" 'enter IP address of your mail server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objMessage.Configuration.Fields.Update
objMessage.Send
Set objMessage = Nothing
Exit Sub
err:
MsgBox "Error!" & vbNewLine & err.Description
Exit Sub
End Sub
-
Sep 7th, 2007, 12:31 AM
#5
Thread Starter
Banned
Re: Emailing in VB6?
I don't have a mail server, neither did my friend.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|