Zoho Deluge : How to send an Email - zoho

I am trying to send an email by using Zoho Custom Function.
My Code :
sendmail
[
from: "email#gmail.com"
to: "email#gmail.com"
subject: "Test Email"
message: "This is mail Body"
]
Give this error :
In cases where From: address is not a zoho.adminuserid or zoho.loginuserid, the To: address can only be zoho.adminuserid and the sendmail task cannot have any CC: or BCC: address.

If you are writing this code for Zoho Creator, It only allows the From Email Address to be zoho.adminuserid (Admin Email) or zoho.loginuserid (Logged-in User Email) system variables.
You can allow more "From" addresses by adding them as Verified Emails. Please refer to https://www.zoho.com/creator/help/forms/set-email-notifications.html#verified%20email%20address.
In the case you provided, you should consider adding "email#gmail.com" as a verified email address.

Try This:
sendmail
[
from: zoho.adminuserid
to: "email#gmail.com"
subject: "Test Email"
message: "This is mail Body"
]
Note:
You can not use both custom email address. One Should zoho system variable or both should be zoho system variable.

Related

Error: Message failed: 553 Relaying disallowed as # . - NodeMail Zoho

After searching for more than 6 hours trying to understand what is zoho's mail problem to send emails!
After i read lots of their answer with no helpful solution, i found the solution is that you need to have the sender option
in your NodeMailer option same like email with same sender name and sender email. like this : from: '"senderNameSameLikeTheZohoOne<emailname#yourwebsite.com>',
my config :
const transporter = nodemailer.createTransport({
service:'Zoho',
host: 'smtp.zoho.com',
port: 465,
secure: true, // use SSL
auth: {
user: `${process.env.EMAIL_ADDRESS}`,
pass: `${process.env.EMAIL_PASSWORD}`
},
});
const mailOptions = {
from: '"senderNameSameLikeTheZohoOne" <emailname#yourwebsite.com>',
to: `${user.email}`,
subject: '',
text:''
,
};
transporter.sendMail(mailOptions, (err, response) => {
if (err) {
console.error('there was an error: ', err);
res.status(401).json(err);
} else {
// console.log('here is the res: ', response);
res.status(200).json('recovery email sent');
}
});
hopefully it helps someone
This helped me a lot.
And to be more specific,
The cause of my error was that the emailname#yourwebsite.com was missing from "from: '"senderNameSameLikeTheZohoOne" emailname#yourwebsite.com'". Immediately I added it, it worked perfectly.
Thanks a lot for the clarification
I spent full night on this !
In my case the email was successfully sent using this command
echo "test-body" | mailx -r senderEamil#tld.com -s "test-subject" reciverEmail#tld.com
But this was not working
echo "test-body" | mailx -s "test-subject" reciverEmail#tld.com
So found that my website is using the host VM user name where it wasn't the same of the sender email smtp config in my postfix
I had two solution
To explictily set a sender username to the postfix check this
Add a user name similar to the sender email at your VM

Unable to send SMTP mails using office365 settings

I am using SMTP mail for sending mail using Laravel. Everything working perfect other than office365 mail settings.
Settings I have used is as below:
SMTP HOST = smtp.office365.com
SMTP PORT = 587
SMTP ENCRYPTION = tls
SMTP USER = username(email)
SMTP PASS = password
Error i am getting is:
554 5.2.0
STOREDRV.Submission.Exception:SendAsDeniedException.MapiExceptionSendAsDenied;
Failed to process message due to a permanent exception with message
Cannot submit message
I have already searched google a lot for this error everybody says about clutter like this link
Solution to this error
But I personally don't find any clutter after followed all the steps mentioned.
I cannot log in this email as it's our client email id and I don't have permission to log in.
I also created one outlook email id and test this email setting.
It worked like charm.
I don't know what is wrong with Client email id.
Any suggestions would be great.
Outlook doesn't provide to send using different from address other than your username to log in.
You need both email address same.
You can add one or more sender in your admin panel after that you can send easily from different addresses.
This error means the user whose credentials you specified in the SMTP connection cannot submit messages on behalf of the user specified in the From and/or Sender MIME headers or the FROM SMTP command.
I face the similar issue and i resolved it right now,
you are most likely facing this issue because your "user" email in the auth option and the "from" email at the mail option are different
make the user and from email same and it will work for you
const transporter = nodemailer.createTransport({
service: 'outlook',
port: 587,
auth: {
user: 'abcde#outlook.com',
pass: '******'
},
tls: {
rejectUnauthorized: false
}
});
// setup email data with unicode symbols
let mailOptions = {
from: "abcde#outlook.com", // sender address
to: 'xyz#gmail.com', // list of receivers
subject: 'Node Contact Request', // Subject line
text: 'Hello world?', // plain text body
html: output // html body
};
// send mail with defined transport object
transporter.sendMail(mailOptions, (error, info) => {
console.log(info);
if (error) {
return console.log(error);
}
console.log('Message sent: %s', info.messageId);
console.log('Preview URL: %s', nodemailer.getTestMessageUrl(info));
});
If your email is not verified you will likely to get more errors
After trying for 4 days, mails started to triggered with port:25, so instead of trying with 587 or 465. Try with other port numbers.
host: "smtp.office***.*",
port:25,
secureConnection: false,
requireTLS: true,
tls: {
ciphers: 'SSLv3'
},
auth: {
user: *,
pass: ***
}
I used Hotmail and had this problem but solved it by editing MAIL_FROM_ADDRESS to be the same as MAIL_USERNAME
Below is my env file set up.
MAIL_MAILER=smtp
MAIL_HOST=smtp-mail.outlook.com
MAIL_PORT=587
MAIL_USERNAME=myemail#hotmail.com (this must be the same as MAIL_FROM_ADDRESS!)
MAIL_PASSWORD=mypassword
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=myemail#hotmail.com (this must be the same as MAIL_USERNAME!)
Everything worked after doing the above.
What works for me is to set DEFAULT_FROM_EMAIL as the EMAIL_HOST_USER.
Working with Office 365 SMTP and Django 3.0.10.
you can also use this Mail-Driver:
https://github.com/motze92/office365-mail
Here you can specify any From-Email Address where your tenant has the permission for. Sent E-Mails will also go into the recipients sent items folder.
for this issue check the jenkins system admin email it is be same as smtp user email
In Spring boot Java you can fix this issue by following code.
application.properties file
spring.mail.properties.mail.smtp.connecttimeout=5000
spring.mail.properties.mail.smtp.timeout=3000
spring.mail.properties.mail.smtp.writetimeout=5000
spring.mail.host=smtp.office365.com
spring.mail.password=password
spring.mail.port=587
spring.mail.username=abc#outlook.com
spring.mail.properties.mail.smtp.starttls.enable=true
security.require-ssl=true
spring.mail.properties.mail.smpt.auth=true
Java class which impliments the mail functionality
#Component
public class MailSenderClass {
#Value("${spring.mail.username}")
private String from;
#Autowired
private JavaMailSender javaMailSender;
public void sendMail(String to, String subject, String body) throws MessagingException {
MimeMessage message = javaMailSender.createMimeMessage();
MimeMessageHelper helper;
helper = new MimeMessageHelper(message, true);//true indicates multipart message
helper.setFrom(from) // <--- THIS IS IMPORTANT
helper.setSubject(subject);
helper.setTo(to);
helper.setText(body, true);//true indicates body is html
javaMailSender.send(message);
}
}
Note: you have to helper.setFrom(from) is important , your issue will be resolved by adding that piece of code.

Google People API - Not returning email addresses

I have working the auth flow to authenticate users using google oauth2. Including the default permissions I added the contacts to get access to the users contact.
Once the user accept the authentication then I can get the contacts using this endpoint:
/v1/people/me/connections?personFields=emailAddresses&access_token=****
As you can see I added the emailAddresses but the response for this api call only return the email address for 1 contact of 149
response example:
{"connections"=>
[
{"resourceName"=>"people/c471****", "etag"=>"%EgIBC..."},
{"resourceName"=>"people/c471****", "etag"=>"%EgIBC..."},
........
{
"resourceName"=>"people/c471****", "etag"=>"%EgIBC...",
"emailAddresses"=>[
{"metadata"=>{"primary"=>true, "source"=>{"type"=>"CONTACT", "id"=>"5123*******"}},
"value"=>"*****#gmail.com", "type"=>"home", "formattedType"=>"Home"}
]
}
.........
{"resourceName"=>"people/c471****", "etag"=>"%EgIBC..."},
{"resourceName"=>"people/c471****", "etag"=>"%EgIBC..."},
],
"totalPeople"=> 149,
"totalItems"=>149
}
Why if the response return 149 contact only one of them contains the email address? I could access to the email for all the contacts?

Parse Server Mail gun adapter installation

First off, I am running Parse Server on AWS Elastic Beanstalk.
I see this documentation in the readme file
##### Email verification and password reset
Verifying user email addresses and enabling password reset via email requries an email adapter. As part of the `parse-server` package we provide an adapter for sending email through Mailgun. To use it, sign up for Mailgun, and add this to your initialization code:
```js
var server = ParseServer({
...otherOptions,
// Enable email verification
verifyUserEmails: true,
// set preventLoginWithUnverifiedEmail to false to allow user to login without verifying their email
// set preventLoginWithUnverifiedEmail to true to prevent user from login if their email is not verified
preventLoginWithUnverifiedEmail: false, // defaults to false
// The public URL of your app.
// This will appear in the link that is used to verify email addresses and reset passwords.
// Set the mount path as it is in serverURL
publicServerURL: 'https://example.com/parse',
// Your apps name. This will appear in the subject and body of the emails that are sent.
appName: 'Parse App',
// The email adapter
emailAdapter: {
module: 'parse-server-simple-mailgun-adapter',
options: {
// The address that your emails come from
fromAddress: 'parse#example.com',
// Your domain from mailgun.com
domain: 'example.com',
// Your API key from mailgun.com
apiKey: 'key-mykey',
}
}
});
This doesn't say enough for me though. I am not using an existing express website and I need to know where in the repository to add the mailgun code.
I already have mailgun and have used it in php and I am using this explicitly to reset user passwords.
so again, What file in my parse server folder do I need to add the mailgun adapter?
This is my file structure. If I am being unclear, let me know...
This is where I am at now as far as adding it in. Is this right? My mailgun creds are not in there yet, but I know to do that.
class ParseServer {
constructor({
appId = requiredParameter('You must provide an appId!'),
masterKey = requiredParameter('You must provide a masterKey!'),
appName,
filesAdapter,
push,
loggerAdapter,
logsFolder,
databaseURI,
databaseOptions,
databaseAdapter,
cloud,
collectionPrefix = '',
clientKey,
javascriptKey,
dotNetKey,
restAPIKey,
webhookKey,
fileKey = undefined,
facebookAppIds = [],
enableAnonymousUsers = true,
allowClientClassCreation = true,
oauth = {},
serverURL = requiredParameter('You must provide a serverURL!'),
maxUploadSize = '20mb',
verifyUserEmails = true,
preventLoginWithUnverifiedEmail = false,
cacheAdapter,
emailAdapter: {
module: 'parse-server-simple-mailgun-adapter',
options: {
// The address that your emails come from
fromAddress: 'parse#example.com',
// Your domain from mailgun.com
domain: 'example.com',
// Your API key from mailgun.com
apiKey: 'key-mykey',
}
},
publicServerURL,
customPages = {
invalidLink: undefined,
verifyEmailSuccess: undefined,
choosePassword: undefined,
passwordResetSuccess: undefined
},
parse-server include the mailgun-js module by default so you can use it without any dependency. What you need to do in order to use it is the following:
Create mailgun account and get an ApiKey from there
Include the mail gun simple adapter exactly like how it is included in the code that you provided and just change the values to the relevant values
please notice that the adapter that you add above is only for email verification and password reset. If you want the ability to send an email (e.g. marketing emails, engagement etc.) you can create a cloud code function there you will need to require the mailgun-js module and use the mailgun-js module to send the email exactly like how it is described in here
Then from your client code you will need to trigger this cloud code function and the email will be sent.

PayPal Adaptive Payments - How do I get an account ID?

I'm trying to use the PayPal Adaptive Payments Payment API. I am trying to test the API with my own email address, but I get an error specifying the sender by email. I'm wondering how to determine my own account ID to try that way?
I'm referring to the account id here: https://developer.paypal.com/docs/classic/api/adaptive-payments/PaymentDetails_API_Operation/
I get the error: "The email address smithd98#gmail.com is invalid. It may not be registered in PayPal's system yet" when trying to pay by my email. When I log in with PayPal my email address is correct. My account is verified with a bank account, credit card, and debit card connected.
Here is my code:
require 'paypal-sdk-adaptivepayments'
PayPal::SDK.configure(
:mode => "sandbox", # Set "live" for production
:app_id => "HIDDEN",
:username => "HIDDEN",
:password => "HIDDEN",
:signature => "HIDDEN" )
#api = PayPal::SDK::AdaptivePayments.new
# Build request object
#pay = #api.build_pay({
:actionType => "PAY",
:cancelUrl => "http://localhost:3000/samples/adaptive_payments/pay",
:currencyCode => "USD",
:feesPayer => "SENDER",
:ipnNotificationUrl => "http://localhost:3000/samples/adaptive_payments/ipn_notify",
:receiverList => {
:receiver => [{
:amount => 1.0,
:email => "smithd98#gmail.com" }] },
:returnUrl => "http://localhost:3000/samples/adaptive_payments/pay" })
##pay.sender.email = "smithd98#gmail.com"
#pay.sender.accountId = 23434
# Make API call & get response
puts #pay.inspect
#response = #api.pay(#pay)
# Access response
if #response.success?
puts 'responsepayKey'
#response.payKey
puts 'url to complete payment'
#api.payment_url(#response) # Url to complete payment
else
puts 'error'
puts #response.error[0].message
puts #response.error[1].parameter.value
end
You can get it via the API using GetPalDetails. You can get it manually in your PayPal profile. Go to the Business Info section and you'll see a Merchant Account ID.
On another note, I see that you're using localhost in your return and cancel URL's, as well as IPN. This isn't going to work. Remember, it's PayPal's server that will be hitting that address. If they hit localhost, they're just hitting their own server, which isn't going to do what you want, of course.
If you want to test all of this with your local test server you'll need to use your IP address or setup some DNS and a domain of some sort. I personally like to follow PayPal's lead and setup a sandbox.domain.com as a test server for any site I'm working on.
David,
To get the Account ID of your test accounts.
Login into your sandbox paypal account at https://www.sandbox.paypal.com/
Click on the "Profile" tab on the top menu
You will see your Account ID for that account beside "Merchant account ID"
It's the same exact process for a real account but instead login into your real paypal account.

Resources