473,434 Members | 1,451 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,434 software developers and data experts.

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 7971
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
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: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.