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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem when sending the Emails via BCA

Status
Not open for further replies.

saumil123

IS-IT--Management
Feb 20, 2004
2
US
Hey there,

I want to send Emails via BCA. I have a small script which uses CDO library from MS Outlook. I am not able to send the Emails. I suspect the reason is that the emails are not being sent to right SMTP server. Could someone please tell me where does CDO send the emails to . How can I see the configurations of where "CDO.sent" is sending the Emails to ?? The script used is as follows:

Dim ObjMessage As CDO.Message
Dim strMessage, strSubject As String
strMessage = "You have got an Email"
strSubject = "Report " & docName & " is ready"
Set ObjMessage = New CDO.Message
ObjMessage.TextBody = strMessage
ObjMessage.Subject = strSubject
ObjMessage.From = &quot;&quot;&quot;ABCD&quot;&quot; <abcd@xyz.com>&quot;
ObjMessage.To = strEmailAddress
ObjMessage.Send
Else
End If
 
Try this
Set OlkApp = CreateObject(&quot;Outlook.Application&quot;)
Set NewMail = OlkApp.CreateItem(olMailItem)
With NewMail
.To = Send
.Body = Body
.Subject = Subject
.Send
End With
 
Hey nimmy99,

Thanks for the reply. I am novice to Macro's coding. I am not sure do I have to define an email account on BCA for this ?? With the new script sent by you is it posbile for you to explain me what will this script do and how will it give me the server name where script will be looking to send the mails (SMTP server for example).

Now since the Production environment has migrated to Texas this script stopped sending emails before migration this script was running fine. So I think the issue probabely is with the way the script looks for the SMTP server to send the emails. Also Do I need to setup an email account on BCA for sending emails to external world(For e.g. abc@hotmail.com)

I am new to this so I will appreciate if the detailed description could be provided.

Thanks,
Sam.
 
This will take the OUTlook from the client. If you like the same from server
Add server.createobject(&quot;outlook&quot;)
 
if you are using SMTP you have to have that on your server.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top