|
-
Sep 2nd, 2005, 05:28 PM
#1
Thread Starter
Junior Member
Sending an email via vb
I wrote a vb script to back up a few files on my pc.
I want it to send me and email when it is done telling me that the files have been backed up.
I an using the following code and I am getting errors
Dim objMessage
Set objMessage = CreateObject("CDO.Message")
If Err.number <> 0 then
WScript.Quit Err.Number
End If
objMessage.Subject = "Test Message"
objMessage.Sender = "[email protected]"
objMessage.To = "[email protected]"
objMessage.TextBody = "This is some sample message text."
objMessage.Send
Error: The "SendUsing" configuration value is invalid.
What do I have to do to fix it. It works fine when I do this via asp on a web page but when I try to do the same thing via a script file, I get that error.
Is there something else I have to add?
Thanks,
DL
-
Sep 2nd, 2005, 09:35 PM
#2
Re: Sending an email via vb
Seems that you need to specify the smtp server?
VB Code:
SmtpMail.SmtpServer = "mail.your-domain.com"
By default, if SmtpMail.SmtpServer is not set, System.Web.Mail is supposed to use localhost as the default property.
However, for some reason this doesn't appear work. If you are using the local SMTP Service to send emails, you may try the following values:
"127.0.0.1"
"localhost"
"the_machine_name_here"
"the_real_dns_name_here"
"the_machine_IP_Address_here"
That should fix it.
From this site here - http://www.systemwebmail.com/faq/4.2.2.aspx
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 
-
Sep 2nd, 2005, 10:09 PM
#3
New Member
Re: Sending an email via vb
Why not just ShellExecute "mailto: your address"? That would open the default e-mail client (Eudora, Outlook, Outlook Express, or whatever the user has as their default client) to send the message.
-
Sep 2nd, 2005, 10:11 PM
#4
Re: Sending an email via vb
Because if the system doesnt have a email client it will brng up the Open With dialog box. Also, with Outlook it will invoke the Security Prompt dialog window before it is Sent.
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 
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
|