no body on email from cfmail - email

I have this code that is sending an email to me when some query is running on database from coldfusion. I'd receive the email without problems but there is no body on it, only shows the subject. I tryed using no type on cfmail tag and changing the cfmailpart tag type="html" for type="text", but nothing happens. The funny thing is that in my local folder CF8/mail/undelivr i can see the body of the email and shows itself without problems, but when this code go to production, doesn't work. Some clue about what is happening?
this is the code i'm using now:
<cfset fechaActual = dateformat(Now(),"dd-mm-yyyy") >
<cfset horaActual = TimeFormat(now(), "HH:mm:ss") >
<cfset archivoActual = CGI.http_host & CGI.script_name & "?" & CGI.query_string>
<cfmail type="html" to="xxx#xxx.com,xxx#xxx.com,xxx#xxx.com" from="xxx#xxx.com" subject="Delete tabla xxx #fechaActual# hrs.">
<cfmailpart type="text">
Este aviso indica que ha sido ejecutado un DELETE en la tabla xxx.
Hora de ejecución: #horaActual#
Fecha de ejecución: #fechaActual#
Ruta:D:\xxx\xxx\xxx\xxx\xxx.cfm
Url: #archivoActual#
Linea: xx
IDs Eliminados: #idaviso#
</cfmailpart>
</cfmail>
Thank you!!!
best regards

I suggest using both text and HTML cfmailparts. Including both increases the probability that they will be readable by everyone. You might want to make the text only cfmailpart very basic with limited information.
Be sure to include text only within the text cfmailpart and HTML formatted text in the HTML cfmailpart.
<cfmail type="html">
<cfmailpart type="text">
Este aviso indica
</cfmailpart>
<cfmailpart type="html">
<p>Some HTML words</p>
</cfmailpart>
</cfmail>

Related

What could be the code to read the default-text value inside an input text in protractor?

I want to read the default text inside an input text field. For Example: -
Reservation Text Value
I want to read - "Enter Reservation Number" from the input field. And I need to verify this text.
Here is the html value: -
<div class="input-field" ng-class="{'has-error': !$ctrl.isValid}">
<input id="reservation-number" class="ng-pristine ng-untouched ng-empty ng-invalid ng-invalid-required ng-valid-maxlength" maxlength="30" required="" title="reservation-number" ng-blur="$ctrl.reservationModified($ctrl.reservationNumber);" ng-model="$ctrl.reservationNumber" type="text">
<label class="avoid-overlap ng-binding" for="resNumber"> Enter Reservations Number </label>
How can I read that using protractor?
I have tried these css value:-
element(by.css('.avoid-overlap.ng-binding').getText();
element(by.css('label.avoid-overlap.ng-binding').getText();
element(by.css('ng-pristine.ng-untouched.ng-empty.ng-invalid.ng-invalid-required.ng-valid-maxlength').getText();
getText() returns a promise.
See the documentation. An example explains how to solve it.
Thank you for the help. It is working now. I tried this code:-
element(by.css('[for="resNumber"]')).getText();
And It is working fine for me.

How to parse html forms in the Go Iris framework?

Sorry if this question is a bit basic, but how can you parse form inputs in the Go Iris framework?
Here is the form I am using
<form action="/" method="post">
Username:<input type="text" name="username">
Password:<input type="password" name="password">
<input type="submit" value="Login">
</form>
here is the route and the controller respectively
iris.Post("/", TestController)
func TestController(c *iris.Context){
username := c.Form.Get("username")//Doesn't work
password := c.Form.Get("password")//Doesn't work
}
how do I retrieve the values in the Post request after the form has been submitted, Thanks
Based off an example on the iris github page you could try c.PostValue("Username"). The code you have may also work but I think you need to capitalize the variable names. In the html template you can see the name value is lowercased, however your context is more likely going off those the variable names to the left of the actual html like Username.

ASP Sending Mail

I am a beginner at ASP programming. I am trying to figure out a simple script to send an email. This is my HTML Code:
<form method="POST" action="email.aspx">
To <input type="text" name="To"/> <br />
From <input type="text" name="From"/> <br />
Subject <input type="text" name="Subject"/> <br />
Body <textarea name="Body" rows="5" cols="20" wrap="physical" >
</textarea>
<input type="submit" />
</form>
This is my ASP code:
Dim mail
mail = Server.CreateObject('CDO.Message')
mail.To = Request.Form("To")
mail.From = Request.Form("From")
mail.Subject = Request.Form("Subject")
mail.TextBody = Request.Form("Body")
mail.Send()
Response.Write("Mail Sent!")
mail = Nothing
I know the set method is no longer supported, I am getting errors with the ASP code, are there any solutions to sending a simple email in ASP? Thank you all in advance!
Your code will only work if CDO or CDONTS is installed and available on your server - though most webhosts that support Classic ASP will make this available.
In VBScript, all objects (i.e. things that aren't numbers or strings) must be assigned using the Set operator. It's silly, I know, but this is what you need to do:
Dim mail
Set mail = Server.CreateObject("CDO.Message")
mail.To = Request.Form("To")
mail.From = Request.Form("From")
mail.Subject = Request.Form("Subject")
mail.TextBody = Request.Form("Body")
mail.Send
Response.Write "Mail Sent!"
Set mail = Nothing
If your server doesn't have CDO or CDONTS installed then you'll get an error message when you call CreateObject, but you haven't listed any error messages in your original question.

How long does CFmail take to send?

I am making an app that creates a custom PDF, mails it and then deletes it. I have tested all 3 components separately and they work but when I put them together the email doesn't send.
Is it possible that the attachment gets deleted before the email is sent even though the delete is after it in the script?
Here is my code.
<!---Get the PDF--->
<cfscript>
PDFBuilder = createobject("component", "form_admin.email.PDFBuilder" );
pdf = PDFBuilder.createPDF(form_id);
</cfscript>
<!---Create link to the pdf --->
<cfscript>
foo = expandPath('../email/tmp/') & pdf & '.pdf';
</cfscript>
<!---Create email--->
<cfmail to="will#hazardousfrog.com"
from="will#hazardoufrog.com"
subject="Jag intrest form. "
type="text/html" >
<cfmailparam file="#foo#">
Dear #getEmail.title#, #getEmail.first_name# #getEmail.surname# <br />
Attached is a PDF boucher telling you more information about the cars you were interested in. <br />
Best wishes <br />
Jaguar <br /><br /><br /><br /><br /><br /><br /><br />
This is not actually jaguar this is a test application by Hazardousfrog.
</cfmail>
<!---Delete the file after it has been sent --->
<cfif FileExists(#foo#)>
<cffile action="delete"
file="#foo#">
<cfelse>
<cfoutput >
error
</cfoutput>
<cfabort>
</cfif>
Sorry if the code isn't great I have only been doing CF for like 2 weeks.
Ok I managed to get the answer from a work friend.
When cfmail is processed the mail is saved into a spool and periodically sent out after about 3 mins.
In my case it meant that the email PDF attachment was being deleted before the message could be sent so the mail was not sending.
The coldFusion mail tag has an attribute to send it straight away or keep it spooled.
spoolenable : Whether to spool mail or always send it Immediately.
So to get it to get my code to work I added this line to my mail attributes.
spoolenable="false"
One other option would be to use the remove attribute of the cfmailparam tag which will tell CF to remove the file after it is sent. This way your spoolenable attribute can be true and it should work as desired. The remove attribute was introduced in version 8.0.1.
I would also place a fileExists() around the cfmail code on whether the pdf file indeed has been created.

Zend_Translate and translation issues

I wonder how I could translate the following?
(french) Vous avez oublié votre mot de passe ?
(english) Forgot your password ?
(dutch) Paswoord vergeten ?
As you may notice, the problem is that in the dutch version, the sentence starts with password and in the french and english version, it starts with the subject/verb.
I usually do it like this:
<?php echo $this->translate('Vous avez oublié votre'); ?>
<?php echo $this->translate('mot de passe'); ?> ?
Unfortunately that won't work here because as said earlier in the dutch version the sentence starts with the password.
You have to use embedded parameters ( %1\$s): http://framework.zend.com/manual/en/zend.translate.using.html