Send emails in buildbot - email

mn2 = MailNotifier(fromaddr="buildbot#example.org",
sendToInterestedUsers=False,
mode = 'all',
extraRecipients=['my#gmail.com'])
I tried using the above code to send email. But it does not send any notification to my gmail account. What might be the problem?

You seem to be missing an important property, relayhost. Your log probably has errors in it from where it tries to send, but gets rejected. He're an example from one of my masters:
buildbot.status.mail.MailNotifier(
fromaddr = from_email,
sendToInterestedUsers = False,
extraRecipients = ['me#mydomain.com'],
mode = 'change',
relayhost = 'relay.mydomain.com')

Related

Changing the response options in Outlook with MATLAB actxserver

Below is a simple example of a MATLAB actxserver for sending Outlook invitations that works without any problems. However, my question is how to turn off the reply options. Required Attendees do not have to reply, whether they are present or not.
out = actxserver('outlook.Application');
appointment = out.CreateItem('olAppointmentItem');
appointment.Subject = 'My Subject';
appointment.Body = 'Appointment in MATLAB';
appointment.Start = '13/01/2022 09:00:00';
appointment.End = '13/01/2022 09:30:00';
appointment.RequiredAttendees = 'one#email.com; two#email.com';
appointment.Save();
appointment.Send
out.release;
You should be able to turn off the ResponseRequested property, from the docs:
https://learn.microsoft.com/en-us/office/vba/api/outlook.appointmentitem.responserequested
Returns a Boolean that indicates True if the sender would like a response to the meeting request for the appointment. Read/write.
i.e. in your case, appointment.ResponseRequested = false;

How to get the newest email with mail-listener2

I am using mail-listener2 to monitor an email account, as check that an email has been recieved as part of a test.
I have used the same implementation defined here: here:Fetching values from email in protractor test case
However, getLastEmail() returns an old email, rather than an email received after the mail-listener2 has started. It returns the first UNSEEN email.
I've looked at whether I can used different mail-listener2 configurations to solve this, but I haven't found anything. I've also tried to use a .last() on the mail returned, but this hasn't worked either.
Does anyone have a configuration solution, or a custom solution that would help to solve this problem?
I think this may help you, I implemented mail-listener2 using the same post you followed and it works great me for me. I just added a few extra parameters:
Under my config's onPrepare, I create a date:
var emailDate = new Date().getTime();
Then under my mailListener initialization:
var mailListener = new MailListener({
username: ...
password: ...
...
searchFilter: ["NEW", "UNSEEN", ["SINCE", emailDate]]
});
This should configure mailListener to only look for emails delivered after the time of emailDate, which is created when your test is started. You can also specify an exact date, i.e. ['SINCE', 'May 20, 2010']
More info on the node-imap docs (which mailListener2 utilizes)
I have this configuration in conf file in the mailListener configurations:
markSeen: true,
Every-time you read the email, it is marked as read and will not be fetched next time. This means that you will always read new emails.
In my case was not enough the previous answer due differences in the server time with gmail server time. So a complete way could be:
var currentDate = new Date().toUTCString()
var mailListener = new MailListener({
...
markSeen: true,
port: 993,
tls: true,
searchFilter: ["UNSEEN", ["SINCE", currentDate]]
});
then your getLastEmail helper could be:
getLastEmail = function () {
var deferred = protractor.promise.defer();
console.log("Waiting for an email...");
const hrs = new Date().getUTCHours()
const minutes = new Date().getUTCMinutes()
mailListener.on("mail", function(mail){
if( hrs=== new Date().getUTCHours("mail.headers.date") &&
minutes- new Date().getUTCMinutes("mail.headers.date") <=1 ) {
deferred.fulfill(mail);
}
});
return deferred.promise;
}
This worked for me.

How to insert data in to database when mail comes in inbox(mail server)

I have a requirement. I have a mail server where user sends mail with there requirement and i need to insert data in my database when mail arrive in mail box. i Have no idea about it. If anybody has any idea please share. Thanks in advance.
Please find the below codes for sending and receiving mails accordingly:
Send Mail
var message = new MailMessage("admin#bendytree.com", "someone#example.com");
message.Subject = "What Up, Dog?";
message.Body = "Why you gotta be all up in my grill?";`enter code here`
SmtpClient mailer = new SmtpClient("smtp.gmail.com", 587);
mailer.Credentials = new NetworkCredential("admin#bendytree.com","YourPasswordHere");
mailer.EnableSsl = true;
mailer.Send(message);
Recieving Mail
client.Connect("pop.gmail.com", 995, true);
client.Authenticate("admin#bendytree.com", "YourPasswordHere");
var count = client.GetMessageCount();
Message message = client.GetMessage(count);
Console.WriteLine(message.Headers.Subject);
You can use this message object for database insertion.

Setting up Email notification with private message on web2py

I set up a website using web2py and I'm looking for help to setup an email notification that will email the the person when they get a private message.
I already have the system able to have a semi message system/private message and I'm wondering how do I integrate that all together so that if a person gets a message, the system can automatically email that user. I been looking around to how to set it up but no luck for myself.
Thank you.
Edit: Before I start trying to integrate the messaging system, I wanted to test it out with the registration since that's the only thing I could find about web2py and email notification.
Edit2: Got the register to work and it says "email is sent". However, no actual email is sent.
This is all in the Models, menu.py. Also tried putting this in the controller, default.py.
auth.settings.register_next = URL('Welcome')
def Welcome():
User_Email = auth.user.email
mail.send(User_Email,'Welcome To website','Welcome To website')
if request.vars.lan == 'En':
redirect('index',vars={'lan':'En'})
else:
redirect('index')
#from gluon.tools import Mail
#mail = Mail()
#mail.settings. = True
#mail = auth.settings.mailer
mail = auth.settings.mailer
mail.settings.tls = False
mail.settings.server = "tls://smtp.gmail.com:587"
mail.settings.sender = "...#gmail.com"
mail.settings.login = "...#gmail.com:password"
# sends an verification e-mail upon registration
auth.settings.registration_requires_verification = True
def send_email(user, subject):
message = "" "Multi line string for %(first_name)s......"
message = open("somefile.html", "r").read()
# you also have the option to include everyone in bcc=[...]
mail.send(to=user.email,
subject=subject,
message=message % user)
user = db(db.auth_user).select()
for user in user:
send_email(user, "some subject")
Also have in the controller/default.py
def login():
auth.settings.registration_requires_verification = True
auth.settings.registration_requires_approval = False
auth.settings.reset_password_requires_verification = True

How do you send an e-mail from Windows Phone 7?

What's the function for sending e-mails from WP7? I'm trying to set up a button to send feedback e-mail, but I can't find the right function.
Thanks,
Zain
Found it. You need to use the EmailComposeTask class. Here's a sample:
using Microsoft.Phone.Tasks;
...
void SendEmail(){
EmailComposeTask email = new EmailComposeTask();
email.To = "receiver#stuff.com";
email.Subject = "hey";
email.Body = "Wazaaaaaaaaaaap! How you doin?";
email.Show();
}