Send email with PHP script - How can I use fields as headers in php function?

amministrazione
22 Posts
amministrazione posted this 07 March 2022
Ask a Question

In "FORM MODULE" I see the fields: (see img1.jpg)
a) email address
b) from
c) subject
d) message

In my just designed form I placed: (see img2.jpg)
a) name
b) email
c) object
d) message

How can I send mail using as object the input field named "object" and other headers?

In "FORM MODULE" I see the fields: (see img1.jpg) a) email address b) from c) subject d) message In my just designed form I placed: (see img2.jpg) a) name b) email c) object d) message How can I send mail using as object the input field named "object" and other headers?

Last edited 08 March 2022 by amministrazione

Vote to pay developers attention to this features or issue.
13 Replies
Order By: Standard | Newest
Support Team
Support Team posted this 09 March 2022

Hi Paolo,

Thanks for contacting us

How can I send mail using as object the input field named "object" and other headers?

Kindly elaborate more on that. Subject is the topic name of the email that you will receive once the visitors are sending the filled out contact form. Message is the informing message that you will receive once the visitors are sending the filled out contact form.

In my just designed form I placed: (see img2.jpg)
a) name
b) email
c) object
d) message
https://resources.nicepage.com/982/73982/img2.JPG

This is the form that a users/visitors will fill out.

In "FORM MODULE" I see the fields: (see img1.jpg)
a) email address
b) from
c) subject
d) message
https://resources.nicepage.com/981/73981/img1.JPG

This is the Submit settings of your Contact Form, that you need set it up, so those filled out forms you will receive on your email.

...................................................
Sincerely,
Ahmad M.
Nicepage Support Team

Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1
Follow us on Facebook: http://facebook.com/nicepageapp

Hi Paolo, Thanks for contacting us >How can I send mail using as object the input field named "object" and other headers? Kindly elaborate more on that. **Subject** is the topic name of the email that you will receive once the visitors are sending the filled out contact form. **Message** is the informing message that you will receive once the visitors are sending the filled out contact form. >In my just designed form I placed: (see img2.jpg) a) name b) email c) object d) message https://resources.nicepage.com/982/73982/img2.JPG This is the form that a users/visitors will fill out. >In "FORM MODULE" I see the fields: (see img1.jpg) a) email address b) from c) subject d) message https://resources.nicepage.com/981/73981/img1.JPG This is the Submit settings of your Contact Form, that you need set it up, so those filled out forms you will receive on your email. ................................................... Sincerely, Ahmad M. Nicepage Support Team Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1 Follow us on Facebook: http://facebook.com/nicepageapp
amministrazione
22 Posts
amministrazione posted this 09 March 2022

I try to better explain my question:
I think that at present the subject field cannot be modified, so I must fill it at design time, I need that customer can explain its personal subject by filling the field "Object" that I have added to the form.

I try to better explain my question: I think that at present the subject field cannot be modified, so I must fill it at design time, I need that customer can explain its personal subject by filling the field "Object" that I have added to the form.
amministrazione
22 Posts
amministrazione posted this 09 March 2022

in other words, with another example... how can I collect the customer email?

in other words, with another example... how can I collect the customer email?
Support Team
Support Team posted this 09 March 2022

Hi Paolo,

For the Subject field you can just add new element Input to your Contact Form so it will be send to you directly along with the filled out form.

in other words, with another example... how can I collect the customer email?

How do you want to collect the email of your users? I mean when you are getting the forms from your customers you can collect the emails. Or you want to make the process on autopilot, in this case you need to use third-party services for email marketing. For integration you can select on your Contact Form >> Submit >> URL option or MailChimp.
...................................................
Sincerely,
Ahmad M.
Nicepage Support Team

Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1
Follow us on Facebook: http://facebook.com/nicepageapp

Hi Paolo, For the Subject field you can just add new element **Input** to your Contact Form so it will be send to you directly along with the filled out form. >in other words, with another example... how can I collect the customer email? How do you want to collect the email of your users? I mean when you are getting the forms from your customers you can collect the emails. Or you want to make the process on autopilot, in this case you need to use third-party services for email marketing. For integration you can select on your Contact Form >> Submit >> URL option or MailChimp. ................................................... Sincerely, Ahmad M. Nicepage Support Team Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1 Follow us on Facebook: http://facebook.com/nicepageapp
amministrazione
22 Posts
amministrazione posted this 09 March 2022

I'm sorry but I'm not sure to understand.
PHP mail function is:

mail(
string $to,
string $subject,
string $message,
array|string $additional_headers = [],
string $additional_params = ""
): bool

parameter "to" will be filled at design time with destination emal address that I set into "email address" text box
parameter "subject" will be filled ... how?
parameter "message" will be filled at runtime with text of the "message" textarea of the form
parameter "additional_headers" will be filled ... how? In additional headers I want use "From: customer@domain.com" collecting customer@domain.com from an inputbox at runtime otherwise I should set the "from" field into the from text box at design time. Please can you better clarify me this point?
Thank you

I'm sorry but I'm not sure to understand. PHP mail function is: mail( string $to, string $subject, string $message, array|string $additional_headers = [], string $additional_params = "" ): bool parameter "to" will be filled at design time with destination emal address that I set into "email address" text box parameter "subject" will be filled ... how? parameter "message" will be filled at runtime with text of the "message" textarea of the form parameter "additional_headers" will be filled ... how? In additional headers I want use "From: customer@domain.com" collecting customer@domain.com from an inputbox at runtime otherwise I should set the "from" field into the from text box at design time. Please can you better clarify me this point? Thank you
Support Team
Support Team posted this 13 March 2022

Hello Paolo,

Our appologies, but can you please specify your issue in more detail?

parameter "to" will be filled at design time with destination emal address that I set into "email address" text box
parameter "subject" will be filled ... how?
parameter "message" will be filled at runtime with text of the "message" textarea of the form
parameter "additional_headers" will be filled ... how? In additional headers I want use "From: customer@domain.com" collecting customer@domain.com from an inputbox at runtime otherwise I should set the "from" field into the from text box at design time. Please can you better clarify me this point?

What do you mean "how?" You don't have to deal with the code. The users will fill out the this form - https://resources.nicepage.com/982/73982/img2.JPG

And you need to set up this settings to receive the data from your website visitors
https://resources.nicepage.com/981/73981/img1.JPG
...................................................
Sincerely,
Ahmad M.
Nicepage Support Team

Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1
Follow us on Facebook: http://facebook.com/nicepageapp

Hello Paolo, Our appologies, but can you please specify your issue in more detail? >parameter "to" will be filled at design time with destination emal address that I set into "email address" text box parameter "subject" will be filled ... how? parameter "message" will be filled at runtime with text of the "message" textarea of the form parameter "additional_headers" will be filled ... how? In additional headers I want use "From: customer@domain.com" collecting customer@domain.com from an inputbox at runtime otherwise I should set the "from" field into the from text box at design time. Please can you better clarify me this point? What do you mean "how?" You don't have to deal with the code. The users will fill out the this form - https://resources.nicepage.com/982/73982/img2.JPG And you need to set up this settings to receive the data from your website visitors https://resources.nicepage.com/981/73981/img1.JPG ................................................... Sincerely, Ahmad M. Nicepage Support Team Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1 Follow us on Facebook: http://facebook.com/nicepageapp
amministrazione
22 Posts
amministrazione posted this 14 March 2022

In these settings (https://resources.nicepage.com/981/73981/img1.JPG) I find the field "FROM"; which data should I use to fill this field?

In these settings (https://resources.nicepage.com/981/73981/img1.JPG) I find the field "FROM"; which data should I use to fill this field?
Support Team
Support Team posted this 14 March 2022

Hello Paolo,

In the field FROM should be another email similar to your email name from the field Where to send submissions and with the same domain name, e.g. customer-service@astolfipaolo.it. From the email in the field FROM, you will be receiving emails on email info@astolfipaolo.it
...................................................
Sincerely,
Ahmad M.
Nicepage Support Team

Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1
Follow us on Facebook: http://facebook.com/nicepageapp

Hello Paolo, In the field **FROM** should be another email similar to your email name from the field **Where to send submissions** and with the same domain name, e.g. *customer-service@astolfipaolo.it*. From the email in the field **FROM**, you will be receiving emails on email ***info@astolfipaolo.it*** ................................................... Sincerely, Ahmad M. Nicepage Support Team Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1 Follow us on Facebook: http://facebook.com/nicepageapp
amministrazione
22 Posts
amministrazione posted this 16 March 2022

Please excuse me, I'm not able to explain... I mean: how can I know the mail of my customer?

Please excuse me, I'm not able to explain... I mean: how can I know the mail of my customer?
Support Team
Support Team posted this 17 March 2022

Hi Paolo,

You will receive it to your mail box ib the submitted form details. Just set up the form, fill it out and send it to yourself. You will see and understand how it works.
...................................................
Sincerely,
Ahmad M.
Nicepage Support Team

Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1
Follow us on Facebook: http://facebook.com/nicepageapp

Hi Paolo, You will receive it to your mail box ib the submitted form details. Just set up the form, fill it out and send it to yourself. You will see and understand how it works. ................................................... Sincerely, Ahmad M. Nicepage Support Team Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1 Follow us on Facebook: http://facebook.com/nicepageapp
amministrazione
22 Posts
amministrazione posted this 21 March 2022

ok, that's how I thought, i posted the work and I see that I get mail from a fake email address (as defined in the from field) with a fixed subject (as defined in the subject field).
I would prefer the email coming from a real email address (my customer's address) with the subject actually entered by my customer, maybe it could be planned for the next versions?

ok, that's how I thought, i posted the work and I see that I get mail from a fake email address (as defined in the from field) with a fixed subject (as defined in the subject field). I would prefer the email coming from a real email address (my customer's address) with the subject actually entered by my customer, maybe it could be planned for the next versions?
Support Team
Support Team posted this 21 March 2022

Hi Paolo,

This is the Form submission, you are getting there your customer email, the subject and message itself.

If you want to receive the "real" email from a user/customer/visitor you need to place a link to your email, so they can send the email to you directly.

As an example for demo purposes you can check the video down below.
https://www.youtube.com/watch?v=j_lo8rvpsh4
...................................................
Sincerely,
Ahmad M.
Nicepage Support Team

Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1
Follow us on Facebook: http://facebook.com/nicepageapp

Hi Paolo, This is the Form submission, you are getting there your customer email, the subject and message itself. If you want to receive the "real" email from a user/customer/visitor you need to place a link to your email, so they can send the email to you directly. As an example for demo purposes you can check the video down below. https://www.youtube.com/watch?v=j_lo8rvpsh4 ................................................... Sincerely, Ahmad M. Nicepage Support Team Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1 Follow us on Facebook: http://facebook.com/nicepageapp
amministrazione
22 Posts
amministrazione posted this 19 April 2022

it's clear, thank you.

it's clear, thank you.
You must log in or register to leave comments