I am trying to send email using NodeMailer Node module and IBM Domino server.
I need to send email to a recipient Domino Administrator/test#test but the space in address creates issue.
Because of space in address, Server return error as it considers recipient as Administrator/test#test which does not exists.
Router: Unable to deliver message 0023B889 to Administrator/test#test.
I tried adding ascii characters for space, tried surrounding by extra quotes but nothing worked.
I am initializing mail options in Nodemailer like this
var mailOptions = {
from: 'Domino Administrator/test',
to: 'Domino Administrator/test#test',
subject: 'Sending mail domino 2',
text: 'That was easy!'
};
Any idea how to handle space ? or any changes needs to be done at Domino server side ?
Taking hint from some RFC , I was able to sort this issue by adding '_'. So the code works if recipient address is to: 'Domino_Administrator/test#test'
Related
I have a workflow which looks like below.
The first task of this workflow runs a simple select * query and the next one sends an email. They are working fine individually. What I want is to send the output of the SQL task as an input to the email task so that it can be attached to the email being sent.
I have tried to manually enter the runId of the SQL task in below field of notification object and it works as expected. But how to make this field take dynamic value from its predecessor instead of a hardcoded one?
Also, is there a way I can include the output of the select * in the email body as a table ?
Update --1
I was able to get a hold of runId of preceding task via the below script. Now only need help with including it in the mail body as opposed to attachement.
:SET &NR# = SYS_ACT_PREV_NR()
:PRINT "RunID of the previous task is &NR#."
Firstly;
Setup
The package is loaded by running the following scripts.
sys/passwordord AS SYSDBA
#$ORACLE_HOME/rdbms/admin/utlmail.sql
#$ORACLE_HOME/rdbms/admin/prvtmail.plb
In addition the SMTP_OUT_SERVER parameter must be set to identify the SMTP server.
CONN sys/password AS SYSDBA
ALTER SYSTEM SET smtp_out_server='smtp.domain.com' SCOPE=SPFILE;
-- Instance restart only necessary in 10gR1.
SHUTDOWN IMMEDIATE
STARTUP
I would suggest you use a mail relay on the database server, rather than connecting directly to an external mail server. The mail relay configuration can be simple, with a reference to "localhost" in the SMTP_OUT_SERVER parameter. Any complexities about connecting to your external mail server are then hidden in the mail relay configuration.
Send Emails
With the configuration complete we can now send a mail using the SEND procedure. It accepts the following parameters.
SENDER : This should be a valid email address.
RECIPIENTS : A comma-separated list of email addresses.
CC : An optional comma-separated list of email addresses.
BCC : An optional comma-separated list of email addresses.
SUBJECT : The subject line for the email.
MESSAGE : The email body.
MIME_TYPE : Set to 'text/plain; charset=us-ascii' by default.
PRIORITY : (1-5) Set to 3 by default.
REPLYTO : Introduced in 11gR2. A valid email address.
Below is an example of the usage.
BEGIN
UTL_MAIL.send(sender => 'me#domain.com',
recipients => 'person1#domain.com,person2#domain.com',
cc => 'person3#domain.com',
bcc => 'myboss#domain.com',
subject => 'UTL_MAIL Test',
message => 'If you get this message it worked!');
END;
/
Send Emails with Attachments
The package also supports sending mails with RAW and VARCHAR2 attachments using the SEND_ATTACH_RAW and SEND_ATTACH_VARCHAR2 packages respectively. They work in a similar fashion to the SEND procedure, with a few extra parameters.
ATTACHMENT : The contents of the attachment. This should be VARCHAR2 or RAW depending on which procedure you call.
ATT_INLINE : Indicates if the attachment should be readable inline. Default FALSE.
ATT_MIME_TYPE : The default is 'text/plain; charset=us-ascii'.
ATT_FILENAME : The name for the attachment.
Below is an example of sending an email with a text attachment.
BEGIN
UTL_MAIL.send_attach_varchar2 (
sender => 'me#domain.com',
recipients => 'person1#domain.com,person2#domain.com',
cc => 'person3#domain.com',
bcc => 'myboss#domain.com',
subject => 'UTL_MAIL Test',
message => 'If you get this message it worked!',
attachment => 'The is the contents of the attachment.',
att_filename => 'my_attachment.txt'
);
END;
/
I'm using plus-addressing on Exim to create an automated system - I will process emails based on the local part of the address. So eg:
From: me#eximdomain.com
To: robot+project-4#eximdomain.com
This works well - I can process it based on the To address (specifically project-4). But ideally I want to be able to BCC an email to this address, eg:
From: me#eximdomain.com
To: somebody#otherdomain.com
Bcc: robot+project-4#eximdomain.com
When I am checking the mailbox for robot, I see the message, but nowhere in the header is the actual address that got it there, ie robot+project-4#eximdomain.com - so I cannot process it.
Obviously I do not want somebody#otherdomain.com to be aware of this address; but when robot#eximdomain.com receives it, I want to know that it was actually BCCd to robot+project-4#eximdomain.com (in some/any header).
Is there any way to do this?
Figured this out, if anyone comes across this: added this option to my local delivery transport (Dovecot LMTP in my case):
envelope_to_add = true
It then generates an Envelope-to header containing the incoming address.
I am having issue with html sent vis aws-ses. Every once in a while it sends base64 text in email body. I was able to capture a html that has this problem and could not figure out the issue - hoping if any one else has any idea on how to fix it.
I even created a test case to reproduce this issue.
Test case link: https://drive.google.com/file/d/1LWrnQowI4yLr1nYOSzcCF7_gH1sJ9_ht/view?usp=sharing
I am using java sdk to send email via SES and transmitting HTML to ses server but it sends base64 characters in email body as shown below:
=?UTF-8?B?PCEtLVtpZiBndGUgbXNvIDldPjx4bWw+CiAgICAgPG86T2Zm?= =?UTF-8?B?aWNlRG9jdW1lbnRTZXR0aW5ncz4KICAgICAgPG86QWxsb3dQTg==?= =?UTF-8?B?Ry8+CiAgICAgIDxvOlBpeGVsc1BlckluY2g+OTY8L286UGl4?= =?UTF-8?B?ZWxzUGVySW5jaD4KICAgICA8L286T2ZmaWNlRG9jdW1lbnRTZQ==?= =?UTF-8?B?dHRpbmdzPgogICAgPC94bWw+PCFbZW5kaWZdLS0+CjxodG1s?= =?UTF-8?B?PgogPGhlYWQ+IAogIDxtZXRhIGh0dHAtZXF1aXY9IkNvbnRlbg==?= =?UTF-8?B?dC1UeXBlIiBjb250ZW50PSJ0ZXh0L2h0bWw7IGNoYXJzZXQ9?= =?UTF-8?B?dXRmLTgiIC8+IAogIDxtZXRhIG5hbWU9InZpZXdwb3J0IiBjbw==?= =?UTF-8?B?bnRlbnQ9IndpZHRoPWRldmljZS13aWR0aCIgLz4gCiAgPCEt?= =?UTF-8?B?LVtpZiAhbXNvXT48IS0tPiAKICA8bWV0YSBodHRwLWVxdWl2PQ==?= =?UTF-8?B?IlgtVUEtQ29tcGF0aWJsZSIgY29udGVudD0iSUU9ZWRnZSIg?= =?UTF-8?B?Lz4gCiAgPCEtLTwhW2VuZGlmXS0tPiAKICA8dGl0bGU+PC90aQ==?= =?UTF-8?B?dGxlPiAKICA8c3R5bGUgaWQ9Im1lZGlhLXF1ZXJ5IiB0eXBl?= =?UTF-8?B?PSJ0ZXh0L2NzcyI+Ym9keSB7CiAgbWFyZ2luOiAwOwogIHBhZA==?= =?UTF-8?B?ZGluZzogMDsgfQoKdGFibGUsIHRyLCB0ZCB7CiAgdmVydGljYQ==?= =?UTF-8?B?
I'm reading emails from pop3 server with zend mail component.
What I want is to know who is sent this email and when I try $message->from I see "FirstName LastName" without senders email.
I do print_r($message->getHeaders()) and do not see sender's email in any header from this email.
I thought that senders email is required and always must be set. Anything wrong here?
Is that possible to have email with "from" header with only First/Last name without email?
As per my comment:
if you print_r() a valid from header and the address is in angle brackets, you may only see it by viewing the HTML source, because the angle brackets and email address may be treated as an (albeit unrecognised) HTML tag, by the browser.
However, if anyone encounters this issue in the future (and the email address does not show in the HTML source), it is worth bearing in mind that the sender could have sent an email without a From: address, even though that is technically invalid.
Yes, this is totally possible. There are 2 usually "FROM" addressess with every email. 99% of the time, these are the same values, but they can be different. There is the MAIL FROM address that is used during the SMTP session, that issues the MAIL FROM command. Then, there is the FROM address found in the email message headers (this FROM address is sent during the SMTP DATA command). This is how you can get email spoofing.
Think of it this way (in the snail mail physical world). You can have a FROM address on the outside of an envelope (this would be equiv to the MAIL FROM command). This is supposed to be the person sending the message. You can then have a FROM value that is different on the letter head that is inside the envelope. This would be the FROM value you are seeing in the email headers.
Here is an example of some raw headers without a FROM address
From: "Steve James"
To: "John Doe" <you#yourcompany.com>
Date: Fri, 24 Feb 2012 07:43:40 -0800
Subject: Here is the progress report
....
Hopefully I didn't make that about as clear as mud.
--
Use the following format:
Firstname Lastname <vasya#poupkine.com>
I'm trying to create an application that sends an email to an smtp-server.
The server is not set fixed, but will be looked up according to the domainpart of the email-address where the email should be sent to.
Example:
Email To: test#stackoverflow.com
Domain-Part: stackoverflow.com
Result of a MX-Record Lookup (commandline "nslookup -type=mx stackoverflow.com":
stackoverflow.com MX preference = 30, mail exchanger = stackoverflow.com.s9b1.psmtp.com
stackoverflow.com MX preference = 40, mail exchanger = stackoverflow.com.s9b2.psmtp.com
stackoverflow.com MX preference = 10, mail exchanger = stackoverflow.com.s9a1.psmtp.com
stackoverflow.com MX preference = 20, mail exchanger = stackoverflow.com.s9a2.psmtp.com
It would be quite useful, to know if the message was accepted by the mailserver and the message was successfully sent.
What I am able so far is, that I can get the SMTP-Server error code (if there was an error (StatusCode 5xx) by using the System.Net.Mail.SMTPClient Object and its SendAsync Function. There, if there was an error, I get an Exception-Object in the Callback-Event of the SMTPClient
I'm well aware that not every mailserver will tell me if the mailaccount truly exists and then reject my mail with an errorcode but instead just accept the message and then delete it. Therefore I would be grateful for another Method to check if the mail was sent (note: not read, that would be the read confirmation)
The final purpose would be:
Try to send an email to a recipient using it's domains mailserver and if it fails, proceed according to the errorcode (user does not exist -> abort / mailserver did not respond -> use another mailserver if available).
Thanks in advance (and sorry for typos :))
Unfortunately what you are looking for does not exist. Email jumps through so many hops that there is no definition of what "sent" actually means. For instance, your example of stackoverflow actually points to Postini's email servers. Postini probably passes the email around from gateways to AV's and routers. From there they either pool email or pass them on to another email server.
With email, the closest definition of "sent" is "at least I didn't get an error".
Also, a minor thing, but when using nslookup remember to add a trailing period to the domain, otherwise the domain search list is used. Generally not a big deal but every once in a while it might trip you up.
nslookup -type=mx stackoverflow.com.