Copy link to clipboard
Copied
Hello everyone,
I found this beautiful javascript somewhere on the net (unfortunately I can't remember exactly where),
I would like to add a subject to this script.
As a total beginner, I need the help of the specialists here.
How and where do I add a subject to the existing script without changing anything else to the script?
allgood();
function allgood()
{
var adr="info@datenschutz-roemer.de";
for (var i=0;i<this.numFields;i++)
{
var fName=this.getNthFieldName(i);
var f=this.getField(fName);
if (f.name == "E-Mail")
{
if(f.value != "")
{
adr=f.value;
}
}
}
if (adr=="")
{
app.alert("Keine E-Mail-Adresse angegeben!");
}
else
{
this.mailDoc({bUI: true, cTo: adr});
}
}
Thanks everyone in advance
Nikolaos.
Copy link to clipboard
Copied
Change this line:
this.mailDoc({bUI: true, cTo: adr});
To:
this.mailDoc({bUI: true, cTo: adr, cSubject: "Subject text of the email"});
Copy link to clipboard
Copied
It is what it is ... a dream
That happens when you have your head full ...
Didn't include the c before the subject.
I didn't see the forest for all the trees.
Many thanks
Nikolaos.