MailHost: sending out email - plone

How one could do / where in Plone source code could be an example code for sending out MailHost emails
Message payload is a text string, not template
Sends out plaintext email, utf-8 encoded, both subject and message
From: header is set correctly having both name and email address visible

This doc could help :
http://plone.org/documentation/manual/upgrade-guide/version/upgrading-plone-3-x-to-4.0/updating-add-on-products-for-plone-4.0/mailhost.securesend-is-now-deprecated-use-send-instead

Related

MailKit returns empty From on a fetch

I was testing MailKit with Fetch on the mail Envelope. summary.Envelope.From[0] gave an exception after getting emails from the mail server. On inspection, the From field is shown on the original mail file as:
...
...
From: Root User <>
...
Gmail shows this mail as (unknown sender)
I can attach the header if necessary. Is there a standard way to deal with this?
Yes, you can do what GMail does which is effectively:
if (summary.Envelope.From.Count == 0)
return "(unknown sender)";

CDO.Message To and From Fields Changed to "Friendly Name" and Email Address

When I first created this Classic ASP script, with the help of W3Schools, to send email, it worked fine. Now I'm having issues with sending the actual email; it appears to hang on the .Send method.
I noticed that when I set the To and From email address to just the email address, it reformats it to a "Friendly Name"/Email Address format:
myMail.From="Support#myDomain.com"
Response.Write myMail.From
The output of the Response Write is:
"Support#myDomain.com" <Support#myDomain.com>
I don't know if this was happening before, or if I should be setting the To and From fields in this format. Just to check if this is causing my problem, is there anyway to prevent these fields from being changed from just the email address?
Maybe the e-mail sending from the server now needs some kind of authentication such as setting these fields:
' Outgoing SMTP server.
objCDO.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.mydomain.com"
objCDO.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objCDO.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objCDO.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
' Type of authentication, 0=NONE, 1-Basic (Base64 encoded), and 2=NTLM.
objCDO.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
' UserID on the SMTP server
objCDO.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "support#mydomain.com"
' Password on the SMTP server
objCDO.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "myemailpassword"
' Update config.
objCDO.Configuration.Fields.Update
The issue stemmed from the fact that the "From" email address was actually a distribution list and the account credentials used to login to the email server were not authorized to "Send As". Once that was rectified emails sent without further problems.
Thanks for the response.

Meteor,unable to send verification email

I'm trying to send verification mail but it showing some error
my error is URI malformed
First,error screenshot
I added email package and at the server side i added something like
Accounts.config({
sendVerificationEmail:true
});
i set env_url like this
process.env.MAIL_URL = 'smtp://postmaster%sandbox.mailgun.password#smtp.mailgun.org:587';
URIs use percent encoding for reserved characters, and a % by itself is invalid. Also, there should be a : between the username and the password (see the docs). This should be the format you want:
'smtp://postmaster%40sandbox.mailgun:password#smtp.mailgun.org:587'
which decodes to:
'smtp://postmaster#sandbox.mailgun:password#smtp.mailgun.org:587'

Validate CSR text in a web application

There is a web user interface through which user is posting csr text in the website. there is a textbox in which user paste the csr text that is generated by a tool.
Previously i was validating the text , by checking if there is
---Begin Request --- and ---End Request---- present in the text.
But
---Begin Request ---
blah blah
---End Request----
is not a valid CSr text, But it is validated by my site since it contains the begin and end tag. How can i validate the CSR text, IS there any web api present to which i can send the request and it can validate the request and send the response back.
request = new CX509CertificateRequestPkcs10();
request.InitializeDecode("Actual csr", EncodingType.XCN_CRYPT_STRING_BASE64REQUESTHEADER);
replace "Actual CSR" with the csr provided by the user.
you can use the above method which will validate if it is a valid BASE64 Request or not.(i.e. a valid CSR)

How to write a functional test for Symfony2 email sent with SwitfMailer

I want to write a functional test (WebTestCase) for a Symfony2 project, for a controller that sends an email to a user.
I want to test whether SwiftMailer has successfully sent/spooled the email, or in other words if the ->send() function returned successfully. I also need to assert the body contents, email address and check if the content type is text/html for the mail sent.
How do I go about doing this?

Resources