473,473 Members | 1,965 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

User defined type not defined

Hello all,
I am trying to write a prog that autamatically sends emails ...
Here is what I have done so far
In the module section I have put this:

Public Function SendEmail(email As String, subject As String, body As
String, attach As String)

Dim Mail As MailSender
Set Mail = New MailSender
Mail.Host = "relay.skynet.be"
Mail.From = "my*************@myprovider.be"
Mail.AddAddress (email)
Mail.subject = subject
Mail.body = body
Mail.AddAttachment (attach)

Mail.Send

End Function

Then in the program I assign values to the variables email,subject and body
Next I call the function ...
x = SendEmail(email, subject, body + Chr(13) + "Test", "c:\log.txt")
on running it I get this err-message:
User defined type not defined
How do I solve this , Can anybody help me with that ?
Any suggestions very much appreciated

Ronny Sigo
Nov 12 '05 #1
2 7975
What is MailSender? To declare something like that, you either need to have
a reference set to an ActiveX component by that name, or else have a Class
with that name in your application.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(No private e-mails, please)

"Ronny Sigo" <ro********@example.invalid> wrote in message
news:3f***********************@reader1.news.skynet .be...
Hello all,
I am trying to write a prog that autamatically sends emails ...
Here is what I have done so far
In the module section I have put this:

Public Function SendEmail(email As String, subject As String, body As
String, attach As String)

Dim Mail As MailSender
Set Mail = New MailSender
Mail.Host = "relay.skynet.be"
Mail.From = "my*************@myprovider.be"
Mail.AddAddress (email)
Mail.subject = subject
Mail.body = body
Mail.AddAttachment (attach)

Mail.Send

End Function

Then in the program I assign values to the variables email,subject and body Next I call the function ...
x = SendEmail(email, subject, body + Chr(13) + "Test", "c:\log.txt")
on running it I get this err-message:
User defined type not defined
How do I solve this , Can anybody help me with that ?
Any suggestions very much appreciated

Ronny Sigo

Nov 12 '05 #2
Hi Ronny,

Reply via google so someone else may have already responded...

I would say that you have no reference to the MailSender server thus
Access cannot create the object.

Goto Tools > References and reference the appropriate library. You
should be able to see the MailSender object in your object browser
once it referenced. Intellisense should also work with the object.

Alternatively check out the CreateObject and GetObject methods. This
will allow you to use late binding - ie you don't need to reference
the library.

Peter

"Ronny Sigo" <ro********@example.invalid> wrote in message news:<3f***********************@reader1.news.skyne t.be>...
Hello all,
I am trying to write a prog that autamatically sends emails ...
Here is what I have done so far
In the module section I have put this:

Public Function SendEmail(email As String, subject As String, body As
String, attach As String)

Dim Mail As MailSender
Set Mail = New MailSender
Mail.Host = "relay.skynet.be"
Mail.From = "my*************@myprovider.be"
Mail.AddAddress (email)
Mail.subject = subject
Mail.body = body
Mail.AddAttachment (attach)

Mail.Send

End Function

Then in the program I assign values to the variables email,subject and body
Next I call the function ...
x = SendEmail(email, subject, body + Chr(13) + "Test", "c:\log.txt")
on running it I get this err-message:
User defined type not defined
How do I solve this , Can anybody help me with that ?
Any suggestions very much appreciated

Ronny Sigo

Nov 12 '05 #3

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

Similar topics

1
by: Guilherme Pinto | last post by:
Hello. I am reading the book written by Bjarne Stroustrup called " The C++ Programming Language - Special Edition" and had a doubt which a think is really important to distinguish between the...
13
by: dawatson833 | last post by:
I have several stored procedures with parameters that are defined with user defined data types. The time it takes to run the procedures can take 10 - 50 seconds depending on the procedure. If I...
3
by: Vivek Sharma | last post by:
Hi, I have created a dropdownlist as a web user control. I am using its multiple instances on the webpage. How do I access the selectedValue of each instance? All the instances have different...
2
by: paul meaney | last post by:
All, myself and another developer have been staring blankly at a screen for the past 48 hours and are wondering just what stunningly obvious thing we are missing. We are trying to load up 2...
2
by: Les Stockton | last post by:
In VB6 you had a Type and End Type to define your own data types. Are the only ways to do this in VB.Net with enums, struct and class. How's the best way to define user defined types?
6
by: karthi | last post by:
hi, I need user defined function that converts string to float in c. since the library function atof and strtod occupies large space in my processor memory I can't use it in my code. regards,...
2
by: =?Utf-8?B?UGV0ZXI=?= | last post by:
I think if the object type of the control is not System.Windows.Forms.xxx, then it is a user-defined control. But how to tell the type of the user-defined control: Composite(User), Extended, and...
6
by: JLupear | last post by:
I have written a code (a translation of my first one) that is not working. I did a user defined function that is used on 'onsubmit'. It should total the value from the form selections and...
1
by: Mikael Vehkajärvi | last post by:
Hello I am running ASP.NET (C#) using Oracle (PL/SQL, provider ODP.NET 11.1.0.6.20) and I have a procedure which at the moment returns a table of records. The code below demonstrates this. ...
1
by: remya1000 | last post by:
i'm using VB.net 2003 application program. i'm trying to convert a VB6 program to VB.NET. The VB6 code i'm trying to convert is shown below. declared g_Share() array in module and trying to add...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...
0
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,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...

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.