CDO .from -> using variables (1 Viewer)

Jamster45

New member
Local time
Today, 12:42
Joined
Aug 15, 2018
Messages
7
Hi There,

I have a form where i can send email from.
I want the user to fill in the senders name and the senders emailaddress.

The name is fixed but the emailaddress not, i need some help!

Here is the code

With mail
.To = Me.emailadres
.From = "" & Me.afzenderNaam & " <onzin@crap.nl>"

Someone an idea to make both fields variable?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 12:42
Joined
Oct 29, 2018
Messages
21,515
Hi. You can just remove the fixed name and either ask the user to enter both together or use one more variable.
 

Jamster45

New member
Local time
Today, 12:42
Joined
Aug 15, 2018
Messages
7
Well i tried that but then the fromaddress and fromname are the same then.
Any suggestion how to program it, like you said?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 12:42
Joined
Oct 29, 2018
Messages
21,515
Well i tried that but then the fromaddress and fromname are the same then.
Any suggestion how to program it, like you said?
What is in Me.afzenderNaam? Is it coming from a table?
 

Jamster45

New member
Local time
Today, 12:42
Joined
Aug 15, 2018
Messages
7
I have to fields in a form: FromName and FromAddress
They are not coming from a table.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 12:42
Joined
Oct 29, 2018
Messages
21,515
I have to fields in a form: FromName and FromAddress
They are not coming from a table.
So, what happens if you tried:
Code:
.From = Me.FromName & " " & Me.FromAddress
 

Users who are viewing this thread

Top Bottom