|
-
Dec 1st, 2004, 07:58 PM
#1
Thread Starter
Banned
smtp
I haven't posted in some time in this forum...so first HALOOOOOOOOOOOOOOOOOOO HALOOOOOOOOOOOO
Secondly, I dont want to use outlook to send mail from a vb app...I want to use SMTP. What I need to do is grab some data from a sql database (which I've done)...
Now how do I send mail using SMTP in VB ?
Examples would be nice .
Thanks,
Jon
-
Dec 1st, 2004, 09:42 PM
#2
Hey Jon, sup.
Have you seen this article - SMTP
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Dec 1st, 2004, 09:46 PM
#3
Hyperactive Member
if you don't want to use MAPI (which I believe is what RobDog's link uses) then you can use the Winsock control to interact with the server...I have an example around here someplace, I'll look for it.
"I don't want to live alone until I'm married" - M.M.R.P
-
Dec 1st, 2004, 09:50 PM
#4
Unfortunately, if you have Anti Virus software running, it will sometimes detect that it's a virus or a worm when working with email programs. Especially when using scripting.
-
Dec 1st, 2004, 09:50 PM
#5
It's ASP.NET actually. Using the System.Web.Mail namespace. So
if the underlying calls of it are MAPI then my mistake, but I'm
not sure what it actually is using. Still new to .NET.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Dec 1st, 2004, 10:49 PM
#6
Thread Starter
Banned
Originally posted by RobDog888
Hey Jon, sup.
Have you seen this article - SMTP
Ya but i cant have this as a web app sending mail...
I need an executable...where are the vb.net folks?
No one has an example of using smtp in vb.net??
I guess Ill start playing artound tomorrow with it.
Thanks folks
Jon
-
Dec 1st, 2004, 11:29 PM
#7
Hyperactive Member
Ok, here's basics of SMTP.
Default port: 25
connect, then send the following (with a vbCrLf at the end of each):
"helo"
you'll get a response
"mail from [email protected]"
another response
"rcpt to [email protected]"
another response
"data"
response
"subject This is the Subject"
no response
...rest of message here...
to "close" the email send a single '.' followed by vbCrLf
you'll get a response, then send "quit" to end the session.
"I don't want to live alone until I'm married" - M.M.R.P
-
Dec 8th, 2004, 04:17 AM
#8
Re: smtp
If you want to do it properly, then there are three things you need to do:
- Find the IP address of the mail transfer agent (MTA) of the recipient. This is done by resolving the MX record for the domain to an IP address. This can be done using an API function.
DnsQuery - Make a connection to the users MTA through WinSock on port 25.
- Send the e-mail using the SMTP protocol.
This means the user doesn't have to enter the address of a SMTP relay, such as their ISP's server. You should notify the user when you plan to send e-mail as a matter of courtusy(sp?) and also as mentioned earlier, if a virus scanner or firewall, picks it up they user will then know what your application is doing and is more likely to allow it through.
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
|