Sending Email Through Specific Server
Hiya I am trying to send mails from a website that has been set upfor a project. The emails will not send to outside of the networkbecause of the firewall. The code is as follows:If Len(HRM & "") > 0 then Set Mail=Server.CreateObject("CDONTS.NewMail") Mail.To= HRM Mail.From = "test@test.com" Mail.Subject="Thank you for showing interest in our HRM survey" mail.body = "Hello, this is to be filled out" & vbcrlf Mail.Send() Set Mail=nothing end if NOTE: HRM is a email address taken in from a form on the site.This code works for email addresses inside the network. I need to specify the server and make it go through the network server andthen onto hotmail, yahoo, etc. (I think!!) Does any know if I am on the right track and if so hwo I go about this?Any help would be greatly appreciatedRegardsKar
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Microsoft Outlook VBA - Sending Email From Specific Account
Hey guys
Relatively new to Visual Basic but have managed to design some pretty nice things such as form launchers and such, but I need some help with a problem I'm having
With the way our Sales team is set up, we have two mail addresses. Personal and Confirmations. The personal account is used for prsopecting clients and sending through information - our confirmation account is receipt of their purchase, we need them to send a reply to a message sent from the confirmation account so the sales person will be paid
Basically, I'm looking to create a macro that will automatically select this account or atleast make it as a replyto address.
I've had a look through the objects browser and couldn't figure it out - Even if one of you could help me with how to set either account/from or replyto fields in the form I've created - that would be most appreciated
Cheers
Cav.
-Edit, after further research on the site, I saw
Dim mSession As MAPI.Session
Dim strProfileInfo As MAPI.Session
strProfileInfo = "MyExchangeServerName" & vbLf & "MyLoginID"
Set mSession = New MAPI.Session
mSession.Logon "", "", False, True, 0,True, strProfileInfo
as a possible solution, my problem here is I want it to send the email and return back to the default account. If I use this to open a mail with, then have the macro automatically return back to the default profile/account - will it still send the email I've opened in the macro via the secondary account?
Edited by - Cavalera on 3/18/2004 3:30:08 PM
Sending Email Through Server
Hail,
I want to send an email in my app but not through the workstation where the app is but through a server. Is there a way to achieve this?
Phailak
Problems Sending An Email From VB App Run For SQL Server.
Hi all,
I have a VB application that sends out an email on completion/error (see below for code segment). When run from NT Explore the program is able to send the email and everything works.
What I'm attempting to do is schedule the app to run automatically using the SQL Server Agent. The App appears to run fine at the allotted time but when it comes to the send method (see below) I get the follow error message:
"Unable to perform the operation. The server is not available. Contact your administrator if this condition persists. Could not complete the operation because the service provider does not support it."
Does anybody know what could cause this problem!!
Code Segment:
Code:
'Get an outlook app and a mail item
Dim OutlookApp As Outlook.Application
Dim MailItem As Outlook.MailItem
Set OutlookApp = New Outlook.Application
Set MailItem = OutlookApp.CreateItem(olMailItem)
With MailItem
.To = ToAddress
.Importance = Importance
.Subject = Subject
'if there are any attachments
If Not IsMissing(AttachFileName) And Not IsMissing AttachPath) Then
.Attachments.Add (AttachPath & AttachFileName)
End If
.Body = EmailBody
.Send
End With
Edit: Moved from General
Sending An Email Using Windows Server
Hi All,
Im pretty new to VB. I would like to know how to send an automatic email using VBA (ArcObjects API) from my Windows Server machine. After quite a bit of surfing the net, I found that MAPI,SMTP and Winsock and other external vendors are available. My machine does not have outlook installed, so cant work with MAPI. So I will have to go for SMTP. But im not very clear abt how to find the references and the dlls for the same. Any help would be appreciated. Thanks in advance
Sending An Email Through A Microsoft Exchange Server
I am trying to send out automated email messages through our companies Microsoft Exchange Server. I tried using MAPI but I ran into A message poping up every time that I send an email stating that an outside source is trying to send an email and asking if I want to allow them to do so.
Is there a sample code or starting code that shows how to do this using VB6?
Sending Email Via Lotus Notes Server
i want to send email throguh the mail server and not from the mailbox that is installed on my computer!!!
for example i did it like thisending email via lotus notes server s in PHP:
Code:
ini_set("SMTP","192.168.4.111");
ini_set("smtp_port","25");
ini_set("sendmail_from","peleg@whatswherewhenwhyhow.com");
how do i do the same in VB?
thnaks in advance
Peleg
Sending Email With Attachments Through Proxy Server
I've been using vbSendMail to send email with attachments through a VB6 program using GoDaddy mail servers (which use port 80), however I cannot send email on several computers that go through a proxy server to connect to the internet. I didn't find any documentation in vbSendMail about sending email through a proxy server, wondered if anyone had any suggestions/comments.
Thanks!
Sending Email Via Lotus Notes Server
i want to send email throguh the mail server and not from the mailbox that is installed on my computer!!!
for example i did it like this in PHP:
Code:
ini_set("SMTP","192.168.4.111");
ini_set("smtp_port","25");
ini_set("sendmail_from","peleg@whatswherewhenwhyhow.com");
how do i do the same in VB?
thnaks in advance
Peleg
Automate A Email Send By Dropping An Email Into A Specific Folder
Microsoft Outlook 2000 is the application I wish to try and complete the task in.
I want to be able to drop an email from a general folder into a folder e.g "Allowed" or "Blocked" and it sends an email to the recipent or sender of the email saying that the email was blocked or allowed, depending on which folder it was dropped into respectivly.
I have no idea were to start.
Show Email In Default Email Client Before Sending
Hi
I know this has been asked a lot of time and I checked the forum and did some search but didn't find any answer for this:
My program create reports, and I would like to have a option to send the report from the program. But I would like the Email to be displayed in front of the user before sending it. Showing Email is easy with ShellExecute but I cannot add a report to it.
strAddr = "mailto:"
strAddr = strAddr & "me@home.net?Subject='Fishcake'&Body=ilikefries"
ShellExecute hwnd, "open", strAddr, vbNull, vbNull, SW_SHOWNORMAL
Is there another way to show this?
Thanks!
Sending An Email From An Unexisting Sender Email
i m trying to use CDONTS library to send an email from say billgates@microsoft.com to my mail but it seems that the library recoginzes that billgates@microsoft.com email does not exist. I remember that i did it b4 what am i missing now?
Sending Email From VB With Default Email Client
I need to open the default email client from Visual Basic and input the subject and the body in HTML (got tables and text formatting)
I've tried saving it as a .eml file then opening it using ShellExecute but it only works for Outlook Express and no other programs.
And using mailto doesnt let me put HTML into the body.
Does anyone know any other way of doing this?
Also, I don't want to send the email directly from VB, it needs to be sent from the email client.
Thanks
Sending Email Attachments And Receiving Email????
Hi guys, im trying to send email, which is working perfect, even with 1 attachment, it works like a charm....BUT
i CANNOT send multiple attachments How do i sent multiple attachments???
How do i seperate each filename???
with a "," or with a ";"???
Also, how do i allow my program to receive EMAIL???
plz help.....URGENT
Thanks
<DIESEL>
If it wasn't for the last minute, NOTHING would get done!!!
Sending Text To A Specific Textbox
I've been looking around, and I cannot seem to find a method (pref. the best) to send text to a certain textbox of another window.
I already have the textbox's hwnd (FindWindowEx), I simply need to see how one can go about putting text into that textbox (and sooner than later pressing "Enter" in that textbox).
I've tried using SendMessage.. but I keep getting whacky results (a lot of messed up characters/doesn't even work at times), and SendKeys is purely only the window in focus.. which in this case is bad.
What I've tried: SendMessage boxHwnd, WM_SETTEXT, 0, "send to the textbox already"
Send Email With A Specific Text
Is it possible to let a visual basic send email with say a text from a text box and send it. Without having to press SEND or do anything, the program should do everything herself
thanks VidarJul
Sending Specific Portions Of An Array To A Function
I just recently had a thread about sending arrays as conditions to functions
now I was wondering if it is possible to only send specified parts of an array to the function, because i was only able to send entire arrays and in order to do that i had to redim preserve the arrays which i am informed is horribly slow.
unfortunatly this program relys on speed so just sending parts of the array and skipping the redim would probably be a worthwhile optimization.
if anybody knows how or if it is impossible i would appreciate help
Sending Specific Keystrokes To Internet Explorer
Hi,
I have a simple application that opens Internet Explorer and instructs it to Navigate to a particular URL.
Once it is there (its a form) I need to pass in three presses of the "tab" key followed by one press of the "enter" key
Any advice on how I can perform this would be much appreciated!!
Email A Spreadsheet As Attachment To A Specific Recipiant
Does anyone know the code to email an Excel spreadsheet to a specific recipient as an attachment? I cannot use the mapi as its not licenced on my system.
I have so far recorded a macro, but all it does is open outlook with the attachment, it will not let me record the recipient name, any ideas?
Ideally I would like it to do this and send automatically too.
Email To A Lsit Of Users, Their Specific Worksheet
Hi, can anyone help, I have a spreadsheet that contains a number of worksheets, the master spreadsheet allows for the creation of a schedule type interface, the various other sheets are then updated automatically from this, current ly I have eight users each with their own sheet and I want to be able to send their sheet via email.
Currently I am saving the sheets as htm files which they can look at via the intranet and email them if any changes are made, with the following code
Dim aOutlook As Object
Dim aEmail As Object
Dim rngeAddresses As Range, rngeCell As Range, strRecipients As String
Set aOutlook = CreateObject("Outlook.application")
Set aEmail = aOutlook.createitem(0)
Set rngeAddresses = ActiveSheet.Range("D6572")
For Each rngeCell In rngeAddresses.Cells
strRecipients = strRecipients & rngeCell.Value & ";"
Next
aEmail.importance = 2
aEmail.Subject = "Change(s) made to Rota, week beginning " & ActiveSheet.Range("C9").Value
aEmail.To = strRecipients
aEmail.Send
This is fine but I can't seem to figure out how to attach their worksheet to their individual email, I assume I would have to create another range on the active sheet specifying the users worksheet name but how would I send the worksheet as an attachment, also how would I integrate another range into the code above, can it be done
Any help would be appreciated, thanks
Accessing Outlook And Finding A Specific Email
Gurus,
I need to know how to create a VB program that will access Outlook and find a specific email. The email comes in every morning by a given time from the same email address. Then, I need to open the Excel attachement from this email, open the file, and extract a number off a cell or range of cells.
Thanks in Advance,
VO
Cloak Email Messages For A Specific User Account
I need to figure out the best way to do this and how. I need to
cloak all emails incoming and outgoing for a specific user account
that is off site and connecting using POP3. The client user account
in question is being requested to be cloaked by the owner of the
client company that we host email for. I think this has to be
written on our Exchange 2003 server, but I dont know where to
start. Or is this something that can only be done in VBA on the
client 's Outlook? The client's Outlook is 2000.
Thanks in advance for any assistance on this issue.
Command To Email To Specific Address From A Work Template Doc
Have MS-Word template. Check box, that when clicked, activates email.
Command is ACTIVEDOCUMENT.SENDMAIL
This brings up Outlook.
BUT..I want it to automatically put in the TO:
address so it always goes to right recipient. Any ideas would be most appreciated...
TIA
Email Verification To Server ? Email App
I am working on an app that has some trivial email functions. Here are the code examples I am looking for, they did not turn up in this forum or on other searches
1) Email verification: luser@cbd.net is the email address of some user. Is there a way to query the mail server at cbd.net to see if the email does indeed exists and can recieve?
2) Sending Email: Is there a method/code for sending email from that particular IP to the recipient. Example: luser is running my app on his 56K ISP dialup connect. He has the ip 123.456.678.901 when connected. I want him to be able to type in the email address in the text box, a message in a larger text box, and when he clicks send the recipient get the mail from 123.456.678.901 and NOT thought luser's ISP mail server.
Thanks
Sending Email Via VB
Hallo Hi...
Is it possible to send email and attached file using VB?
If possible how is it. Any idea will be appreciated.
Sending Email
o without using email i want my program tosend messges in text1 and text2 to a such meial
name:text1
comment:text2
could ya tell me 9witout outbook ior nyhtign that comes up just aoutomaticly with a command)
Sending Email With Vb6
Hey all
I'm looking for a way to send email from a vb6 app without using outlook.
I've been looking for a while today and can't seem to find anyway that works.
Also, is an SMTP server required just to send mail? If it isn't, how can it be done without one?
This probably is something that takes a bit of code, so if anyone knows a reference open source program that would be even better.
Thanks a bunch
Help Sending Email In Vb6!
I HAVE A PROGRAM:
Dim x As Integer
Dim y As Integer
Private Sub About_Click()
InputBox ("PLEASE TYPE IN YOUR NAME")
End Sub
Private Sub Command1_Click()
If Text3.Text = x * y Then
MsgBox "WELL DONE YOU GOT THE RIGHT ANSWER"
Call generate
Text3.Text = ""
Else
MsgBox "YOURE * * * *IN STUPID"
End If
End Sub
Private Sub generate()
x = CInt(Int((6 * Rnd()) + 1))
Text1.Text = x
y = CInt(Int((6 * Rnd()) + 1))
Text2.Text = y
End Sub
Private Sub Command2_Click()
x = CInt(Int((90 * Rnd()) + 1))
Text1.Text = x
y = CInt(Int((6 * Rnd()) + 1))
Text2.Text = y
End Sub
Private Sub Exit_Click()
VB.Unload Form1
End Sub
Private Sub Form_Load()
Call generate
End Sub
Private Sub Print_Click()
Form1.PrintForm
End Sub
WHAT I WANT IS TO HAVE 1 BOX FOR THE EMAIL ADDRESS, ONE BOX FOR THE EMAIL MESSAGE AND ONE COMMAND BUTTON TO SEND IT. PLEASE TELL ME HOW TO DO THIS SIMPLY, AS I AM A BEGINNER. THANKS.
Sending Email From Within VB
I'm trying to send out and email from within a vb program. I am working off this code that someone else had written in the program. The problems is I don't want to deal with the permission stuff in outlook where it asks if you want to allow this actione etc. Is there any way to bypass that without lowering the outlook security settings?
Or is there a way to do it without outlook altogether?
here is the code I am using now. it works fine but I get the permission problems with outlook when I try to send out the email.
Thanks
Kelly
Sub SendAnEmailWithOutlook(w_strEmailArrayInvalid() As String, w_strEmailArrayValid() As String, strAction As String, i As Integer, j As Integer)
Dim OLF As Outlook.MAPIFolder, olMailItem As Outlook.MailItem
Dim ToContact As Outlook.Recipient, nCount As Integer
Set OLF = GetObject("", _
"Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(olFolderI nbox)
Set olMailItem = OLF.Items.Add ' creates a new e-mail message
With olMailItem
.Subject = "Your email :: about stuff" ' message subject
Set ToContact = .Recipients.Add("kelly@x.com") ' add a recipient
.Body = “content”
.Send ' sends the e-mail message (puts it in the Outbox)
End With
Set ToContact = Nothing
Set olMailItem = Nothing
Set OLF = Nothing
End Sub
Sending Email Through VB
I'm using Outlook2000 as my object to send emails through my VB program.
this is the code:
Code:
Private Sub Command1_Click()
Dim objOutlook As Object
Dim objOutlookMsg As Object
Set objOutlook = CreateObject("Outlook.Application")
Set objOutlookMsg = objOutlook.CreateItem(0)
With objOutlookMsg
.To = "you@where.com"
.Cc = "ifneed@copy.com"
.Subject = "Hello World (one more time)..."
.Body = "This is the body of message"
.HTMLBody = "HTML version of message"
.Attachments.Add ("c:error1.log")
.Send 'Let´s go!
End With
Set objOutlookMsg = Nothing
Set objOutlook = Nothing
End Sub
Now comes the big question. When ever I execute this code, outlook pops a window saying "an application is trying to send an email on your behalf. Do you want to allow it" and I have to click yes or no. How can I disable this security feature?
If I can't disable it, then is there a VB code that will bypass this and send emails automatically?
Thanks and Regards,
Boiling Ice
Sending Email
Hey is there a way to send email to a person who has an @aol.com address without using outlook express(that messes up our computer). Thanks.
Sending Email
Hi
I am quite new to visual basic i have MS flexigrid with data in it which i collect from excel worksheet. Can any one tell me how can i send that data of flexgrid through email. If there is any alternative idea do tell me its quite urgent.
Thanks in advance
Dhiraj
Sending EMail
Hi, How do I send an eMail from my application. I need to send some files to a remote pc via eMail and I don´t my users to use outlook. Just a Click in a button "Send Files"
Sending Email
I want to send an email from my VB-program from any computer to me. In the email must become standaard text from on input-form.
My problem is I have to know the SMTP-adress of then SMTP-server of the computer where my program is installed.
Can anybody help
Sending Email In VB6
I am making a program to send myself emails. Ive asked about it on other forms and people tell me to use MAPI. I have no idea what MAPI is or how to use it. I was wondering if any one could help me with my problem. Ive been programing in VB6 for about a year. So if you could keep it as simple as possible that would be great.
Thanks,
B|ackWo|f
Sending Email..getting Nothing
i am trying to send an attachment through my hotmail account, back to my hotmail account. but when i send it, i get nothing. i attached what i have. please help.
Sending Email Via VB6
I need to send small text files using VB6 and Netscape email. Is this doable or do I need to buy some software? Thanks?
Sending An Email
I am having an issue that I cannot determine a cause to at this time. I have a user form with a field named Department. based upon the result in the Department field, an email is sent to a specific distribution list upon saving the record. The code for the email generator is listed below:
Sub SendEmailAD()
Dim objMail As Outlook.Application
Dim mleItem As MailItem
U3 = frmFirstNotification.cboCrew.Value
T3 = frmFirstNotification.cboShift.Value
S3 = frmFirstNotification.cboAreas.Value
V3 = frmFirstNotification.DescriptionText.Value
AC3 = frmFirstNotification.DescriptionTB.Value
W3 = frmFirstNotification.WitnessText.Value
X3 = frmFirstNotification.CausesText.Value
Y3 = frmFirstNotification.Safety.Value
AD3 = frmFirstNotification.EnvironmentalCB.Value
AA3 = frmFirstNotification.Fire.Value
AE3 = frmFirstNotification.ProcessUpsetCB.Value
Z3 = frmFirstNotification.Security.Value
AB3 = frmFirstNotification.EquipmentFailure.Value
AF3 = frmFirstNotification.EmployeeCB.Value
Dim blnGet As Boolean
On Error GoTo NoOutlook
Set objMail = GetObject("Outlook.Application")
On Error GoTo 0
CreateMail:
Set mleItem = objMail.CreateItem(0)
With mleItem
.To = "DL.CHL.InstantAlertAdmin"
.Body = "Information has been updated to the database." & vbCrLf & _
"Date: " & R3 & vbCrLf _
& "Incident Report Number : " & Q3 & vbCrLf _
& "Department : " & S3 & vbCrLf _
& "Shift : " & T3 & vbCrLf _
& "Crew : " & U3 & vbCrLf _
& "Employee :" & AF3 & vbCrLf _
& "Description : " & V3 & vbCrLf _
& "Witnesses : " & W3 & vbCrLf _
& "Initial Expected Cause : " & X3 & vbCrLf _
& "The Incident Tyepe is : " & vbCrLf _
& " Safety : " & Y3 & vbCrLf _
& " Security : " & Z3 & vbCrLf _
& " Fire : " & AA3 & vbCrLf _
& " Equip Damage: " & AB3 & vbCrLf _
& " Environmental: " & AD3 & vbCrLf _
& " Process Upset: " & AE3 & vbCrLf
.Subject = "DATBASE UPDATE " & Format(Now, "mm-dd-yy hh:mm:ss")
.Send
End With
If blnGet Then objMail.Quit
Set mleItem = Nothing
Set objMail = Nothing
Exit Sub
NoOutlook:
Set objMail = CreateObject("Outlook.Application")
blnGet = True
Resume CreateMail
End Sub
The issue is that when I have a single name in the .To field for testing it works fine. However, when I put the distribution group in the .To field I get stuck in a loop. I get a prompt saying that a program is attempting to automatically send an email using my account. IF this is not expected it may be a virus and to hit No. If it is expected hit Yes.
When the distribution group is in the .To field, and I hit YES, it just comes back and asks again. This goes on endlessly and I end up having to terminate the program.
Does anyone have any idea as to what may be the cause of this?
Thanks
Sending Email With Vb6
hI,
i found a piece of code in this forum..it sends out an email
Sub TEST()
Dim olMail As MailItem
Set olMail = Application.CreateItem(olMailItem)
With olMail
.To = "A1JIT@YAHOO.COM"
.Subject = "SUBJECT"
.Body = "MESSAGE"
.Attachments.Add ActiveWorkbook.FullName
.Send
End With
Set olMail = Nothing
End Sub
But im not sure why its giving out an error...i think its something to do with some reference..What reference shall i include to make this piece of code to work
Its says object does not support this property/method!
Who Is Sending The Email?
When you click on the New button to create a new email you would put in the "To:" an email address before you hit the send button. Now with a VB6 plugin I am writing I would like to get the .From when the user clicks the Send button. One problem, there is no .From property. Is there a way to get this email address or name of the sender at the time the Send button has been clicked? There is a .SenderName and a .SenderEmailAddress but I beleive this only works on the receiving end after the email has been initially sent out.
Currently I am using:
Private WithEvents m_objMail As Outlook.MailItem
with m_objMail
.To
.CC
....
end with
Sending An Email
Can anyone help,
I am trying to automatically send an email from the press of button in VB.
This is my code:
Code:
Dim myOutlook As Object
Dim myMail As Object
' Make instance
Set myOutlook = CreateObject("Outlook.Application")
Set myMail = myOutlook.CreateItem(0)
myMail.Recipients.Add "i.campbell@xentec.ltd.uk"
myMail.Subject = "Booking Log Full"
myMail.Body = "User " & APPConst.UserName & " could not book a session for patient bla bla"
myMail.Send
Set myOutlook = Nothing
However i keep getting messages up from outlook saying someone is trying to access your email and could be a virus !!
Does anyone know how to get around this ?
Thanks in advance
Ian.
Sending Email
I am trying to send email and this is my code:
Code:
Private Sub Command1_Click()
Dim obj As Object
Set obj = CreateObject("CDO.Message")
With obj
.To = "xxskat3rdudexx@adelphia.net"
.From = "xxskat3rdudexx@adelphia.net"
.Subject = "testing email system"
.TextBody = "It worked!"
.Send
End With
End Sub
What happens is it gives me an error:
"the Senduser configuration is invalid"
And i'm not sure what i'm doing can someone please help me out? Thanks.
Sending Email With Vb6
Hello all
I need help to fix a code for sending email with vb6
to simplify things here is what I have:
Three textboxes and one command button
the code is below:
Code:
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Sub Command1_Click()
cmd$ = "mailto:" & Text1.Text & "?subject=hello Request&Body=Name: " & Text2.Text & vbCrLf & "Number: " & Text3.Text
ShellExecute Me.hwnd, "", cmd$, "", "", 1
end sub
The problem I have is how to make a new line within the email as the VbCrLf
isn't working
Thanks
Sending Email
In my app, I'm using an Outlook object to send emails. But, I wanted to know how can I attach a file to this email ??
my code:
Dim olapp As Object
Set olapp = CreateObject("Outlook.Application")
Set oitem = olapp.CreateItem(0)
With oitem
.Subject = "subject" 'subject of message to send
.To = "user@company.com" 'where/whom to send
.Body = "message" 'message to send
.Send
End With
Set olapp = Nothing
Set oitem = Nothing
Sending An Email?
Hi all,
Can someone point me in the right direction on how I'd go about using VB to send an email?
Sending An Email
Hi
I have selected a customer from the database. That customer has an email address. I would like a button, which, when clicked, would go to my email program. I would like the send-to and subject already populated.
How can I do this?
Thanks
Robert
Sending Email
I want to send an email using my program. I have writtent the code to open the email and fill the send to and subject line.
Now i want to set in the body of the email the caption of a label.
Any idea how to do this. I just keep getting the text Label1.Caption.
Sending Email
hi there i am currently trying to develop a system that can send email using VB.NET does anyone knows where to find some sample coding in how to do it or is there anyone who knows how to do it and can show me how and best is to able to send to hotmail and yahoo thanks
DTS - Sending Email
Hi!
I have program my first DTS Package for the Microsoft SQL Server 7.0.
With the fallowing rows i am going to send an email over CDONTS.
Code:
Sub SendMail(sFromAddress, sToAddress, sSubject, sBody)
Dim objMail, errCode
'Create the mail object
Set objMail = CreateObject("CDONTS.NewMail")
'Set all the properties for this email
objMail.From = sFromAddress
objMail.To = sToAddress
objMail.Subject = sSubject
objMail.Body = sBody
objMail.Send
'Clean up
Set objMail = nothing
End Sub
But if the DTS runs, the fallowing error occurs:
Quote:
Error Code: 0
ErrorSource=Microsoft VBScript runtime error
Error Description: ActiveX component can't create object
Error on Line 77
The Code in Line 77 is "objMail.Send". If i take it out, the DTS runs without any problem! I tried to code the mail properties hard ("objMail.From = "xxx@xxx.com") but it do not works too.
Somebody could help me??!
Thanks a lot! Greetings, DaBoo_
|