473,662 Members | 2,666 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

automatically send a mail

jj
Hi

With the code below I want to send an email when a certain situation occurs.
When I does this from my own computer at home it works very well - but when
I try to use it from a company I get the following error: "Run-time error
'2147220973 (80040213)' : The transport failed to connect to the server. I
am pretty sure I have used the right smtpserver for the company. Anyone
knows what could be the problem, and how I could correct it?

Below the code which works on my private address:
Public Sub SendMail(ByVal SendTo As String, ByVal Subject As String, ByVal _
MessageText As String, Optional ByVal Attachment As String)
Dim Config As Object, Message As Object
Dim CDOSchema As String
CDOSchema = "http://schemas.microso ft.com/cdo/configuration/"
Set Message = CreateObject("C DO.Message")
Set Config = CreateObject("C DO.Configuratio n")
Config.Load -1
With Config.Fields
.Item(CDOSchema & "sendusing" ) = 2
.Item(CDOSchema & "smtpserver ") = "PASMTP.tele.dk "
.Update
End With
With Message
Set .configuration = Config
.configuration. Load 1
.FROM = "Jens Jakobsen"
.Sender = "JJ@get2net .dk" 'Must be a real address
.To = SendTo
.Subject = Subject
.TextBody = MessageText
.Send
End With
End Sub

TIA
/JJ

I'm not reading this email
Apr 24 '06 #1
0 1873

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
3295
by: Steve Horrillo | last post by:
I can't figure out why this script won't insert the subject in the email and why can't I control the font and size being used? I'm not sure where to post this. Let me know where if this is OT. <SCRIPT LANGUAGE="JavaScript"> <!-- Begin function isPPC() { if (navigator.appVersion.indexOf("PPC") != -1) return true; else return false;
6
11175
by: DigitalRick | last post by:
I have been running CDONTS in my ASPpages to send emails to me sent from my guestbook. It had been working fine untill I upgraded to Server 2003 (I am also running Exchange 2003) all locally. I will include the code I originally used. I understand I should switch from CDONTS to CDO mail but after several sttempts I am finding a very hard time getting the new CDO mail to work properly. Any assistance with this would be greatly...
0
1073
by: Monica | last post by:
My database tracks contracts which expire a year from the ContractDate. I would like Access (using 2000/02/and 03) to send an e-mail reminder that the contract is expiring in 5 days for each expiration date. - In this case, is it wise to create a field for expiration date in my table? (There is a control with the calculated expiration date in the form) - How can I have Access send the reminders automatically? using a trigger? I don't...
1
1433
by: clequieu | last post by:
Is there a way to attach a file or document automatically to an e-mail when someone clicks on the button to send an e-mail?
0
1721
by: jjalexrayer | last post by:
How do send mail automatically in asp.net? Public people can register in my website. after registering system will send email every 10 days reports without any admin actions(that means automatically send mail). Can anyone help me? Thanks, J.Alexander.
6
2626
by: atcohaz | last post by:
Hi everybody, I have a personal server (I learning) with Linux with using Cpanel I only need such script which enables me to create email accounts without logging into cPanel. And in which I can provide our visitors email account facilities with script and User cans signup automatically and I can specific quota, username & password length etc. (and which don’t show my Cpanel username and password to users) I have tried script ...
4
1624
by: SHorn | last post by:
Hi all- I created a macro that sends out an email. I am now running into the issue of a security box poping up in which I have to click yes to allow the email to send. It reads: "A program is trying to automatically send an e-mail on your behalf. Do you want to allow this?" Is there a way to have the e-mail send without me clicking Yes? I did read another thread regarding this issue, however I did not understand how to implement the...
1
1230
by: DanielM | last post by:
I know how to create an outlook object. this is the function I wrote: Public Sub Outlook_CreateNew(prmOutLookType As Integer, Optional prmEmailAdress As String, Optional prmMessage As String) Dim objOL As Object Set objOL = CreateObject("Outlook.Application") Dim NewTask As Object Set NewTask = objOL.CreateItem(prmOutLookType) If prmOutLookType = 0 Then 'Mail NewTask.To = prmEmailAdress NewTask.Body =...
0
1171
by: trram1972 | last post by:
Hi, One error has come while trying to send email automatically using the code snippet - Createdispatch failed w/error. This error is coming only when we are trying to call inside a function. Suppose if we call using button click and manually we click button the error hasn't come. While sending throug automatic mail sending(Using manual button click) the user is prompted 'A program is trying automatically send e-mail on your behalf. Do...
7
1601
by: canajien | last post by:
How can I get a php page to automatically send all the contents in an email when it is generated? I managed to hack together a script that sends an email, but it will only send the 1st record returned and I would like it to send all the records that are on the page when it is loaded. <?php $con = mysql_connect("localhost","user","pass"); if (!$con)
0
8435
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8857
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8768
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8633
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7368
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4181
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4348
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2763
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1754
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.