Quantcast
Channel: Active questions tagged email - Stack Overflow
Viewing all 29745 articles
Browse latest View live

How to write a python script to read all subject headers of my Outlook... is it in a date range?

$
0
0

I'm trying to write a script in Python to read all the subject headers, in a range date... but it doesn't work!

I have tried different solution to read emails in this range but I could not find a better option than restrict, I also tried to use [LastModificationTime]

DATA_RANGE_EMAIL = "[SentOn] > '10/01/2019 00:01 AM' AND [SentOn] < '10/10/2019 08:00 AM'"
outlook = win32com.client.Dispatch("Outlook.Application").GetNamespace("MAPI")
utente = outlook.Folders("myaccount@myemail.com")
inbox = utente.folders("Inbox")
CRQ = inbox.folders("CRQ")
messages = CRQ.Items.restrict(DATA_RANGE_EMAIL)
message = messages.GetFirst ()
while message:
    sub = message.subject.encode("utf-8")
    print(sub)
    message_IN = messages.GetNext ()

Now the script read ALL the email, and not just the email in that range... What am I doing wrong?

Thank you to everyone who gives me some advice!


HTML code inside Python function doesn't work

$
0
0

I've written few lines of code for sending emails with the smtplib module. If I run the script as it is:

import smtplib

message = """From: Sender <sender@randomemail.com>
To: Receiver <receive@randomemail.com>
Content-type: text/html
Subject: It works!
<b>It works!</b>\n
<br/>
<br/>
Do not reply to this email or god will strike you down.
"""

server = smtplib.SMTP('mysmtpserver')
sender = 'sender'
receiver = 'receive'

server.set_debuglevel(True)

server.sendmail(sender, receiver, message)

It executes just as intended. And I do have HTML formatting in the email received.

However, if I put the code as a function inside 'bigger' file along other functions:

def emailer():
    import smtplib

    message = """From: Sender <sender@randomemail.com>
    To: Receiver <receive@randomemail.com>
    Content-type: text/html
    Subject: It works!
    <b>It works!</b>\n
    <br/>
    <br/>
    Do not reply to this email or god will strike you down.
    """

    server = smtplib.SMTP('mysmtpserver')
    sender = 'sender'
    receiver = 'receive'

    server.set_debuglevel(True)

    server.sendmail(sender, receiver, message)

Then call the function:

emailer()

I get email with no HTML formatting and totally messed up subject and body, which then get's filtered as spam by my email provider.

I do need some explanation on how to fix that, and also advice if I can improve somehow what I've created.

Thanks

How to disable error messages in PHPMailer?

$
0
0

How do I disable the error messages from the PHPMailer class? I'm displaying my own error messages and I don't want users to see errors such as "SMTP Error: Could not connect to SMTP host."

Thanks

How to bold dynamic cells in VBA?

$
0
0

I checked some posts on formating body of an email in VBA (e.g. How to format email body?, formatting email body using VBA or Bolding Text with VBA) but unfortunately can't solve the problem I'm facing.

I want to format the dynamic cells in the body to be bold

I want the email body to look like that:

Dear User,

The following request is in I8.1 Check Resource Availability:

Test Project

The estimated effort below is called out in the request's ROM (in hours): 10 and duration (in business days): 2 Do you have a named resource I can put in for the effort called out? Please provide me with an update at the earliest

Thank you and best regards,

Team.

This is the code I have for now. It's working but I can't find a way to bold the desired values.

Sub Sendmail()
        Dim OutApp As Object
        Dim OutMail As Object
        Dim cell As Range
        Application.ScreenUpdating = False
        Set OutApp = CreateObject("Outlook.Application")

        On Error GoTo cleanup
        For Each cell In Columns("D").Cells.SpecialCells(xlCellTypeConstants)
            If cell.Value Like "?*@?*.?*" And _
               LCase(Cells(cell.Row, "E").Value) <> "0" Then

                Set OutMail = OutApp.CreateItem(0)

                On Error Resume Next
                With OutMail
                    .To = cell.Value
                    .Subject = "Resources awaiting assignment"
                    .Body = "Dear "& Cells(cell.Row, "C").Value _
                    & ", " _
                    & vbNewLine & vbNewLine & _
                         "The following request is in I8.1 Check Resource Availability: " _
                         & vbNewLine & vbNewLine & _
                         Cells(cell.Row, "A").Value _
                          & vbNewLine & vbNewLine & _
                        "The estimated effort below is called out in the request's ROM (in hours):  "& Cells(cell.Row, "E").Value _
                        & _
                        " and duration (in business days):  "& Cells(cell.Row, "F").Value _
                        & vbNewLine & vbNewLine & _
                        "Do you have a named resource I can put in for the effort called out? Please provide me with an update at the earliest" _
                        & vbNewLine & vbNewLine & _
                        "Thank you and best regards, "& vbNewLine & _
                        "Team."

                    .Display
                End With

                On Error GoTo 0
                Set OutMail = Nothing
            End If
        Next cell

cleanup:
        Set OutApp = Nothing
        Application.ScreenUpdating = True
    End Sub

Can anyone advise on how to format it as desired?

Thanks in advance!

How to create two columns , three columns & two column in same table?

$
0
0

enter image description here

I would like to create a table as shown below for an email template.

Thank you in advance...

How to configure and debug Mercurial NotifyExtension?

$
0
0

The task is: Setup Mercurial on the production server to push email notifications on an email address when someone pushes a new commit from their PC to the repo.

So I'm trying to configure and test NotifyExtension on my local repository. I'm testing HG SERVE to check if I'm getting any emails.

What I tried so far:

[paths]
default = https://source.server.com/hg/repo-name

# path aliases to other clones of this repo in URLs or filesystem paths
# (see 'hg help config.paths' for more info)
#
# default:pushurl = ssh://jdoe@example.net/hg/jdoes-fork
# my-fork         = ssh://jdoe@example.net/hg/jdoes-fork
# my-clone        = /home/jdoe/jdoes-clone

[ui]
# name and email (local to this repository, optional), e.g.
# username = Jane Doe <jdoe@example.com>

[extensions]
notify=

[hooks]
changegroup.notify = python:hgext.notify.hook
incoming.notify = python:hgext.notify.hook
outgoing.notify = python:hgext.notify.hook

[email]
from = Name Lastname <name.lastname@server.com>

[smtp]
host = mail.server.com
username = name.lastname@server.com
password = mypasswordstring
port = 465
tls = true

[web]
baseurl = https://source.server.com/hg

[reposubs]
* = name.lastname@server.com

[notify]
sources = serve push pull bundle
test = False

[ui]
debug = True

Might be obvious to someone, but it's not sending any emails.

Running in my repository:

hg help

returns that notify extension is enabled but I'm not getting any emails.

  1. Do I need any software other than Mercurial installed? (Running Ubuntu 18.04.2 LTS locally)
  2. Is there any place I can check for logs?
  3. What could be wrong in my configuration?

Thanks in advance.

How do I handle downloading e-mails and attachments from an IMAP server in C#?

$
0
0

I've been googling and googling and I've found several nuget packages that can do what I want, but for some reason they cost anywhere between 200 and 600 dollars to use?

I've used countless nuget packages in my C# projects over time and I've never seen one that requires me to pay anything for them? I mean, SignalR = free, recapha = free and the list goes on, free free free, but for some reason when I wanna do something as simple as handle e-mails from a server there's no solution without paying (a really expensive price) for it?

So is there a way I can handle pulling down e-mails+attachments from an IMAP mail server without having to pay a fortune for it? What should I be looking into?¨

I'm not paying a dime for pulling dime e-mail from an imap server and getting attachments, so any pay options are irrelevant to this question.

Thanks

Using Mailjet to send email in PHP

$
0
0

I'm new to PHP and am doing a small project that's only on my localhost. I need it to actually send emails so I can verify that it's working. How the program work is there a form for the admin to fill out and send an email to a user in the database and the form is sent to the page that runs the API sending. I tried it with the example Mailjet had and it actually sent the email to my specified recipient, but I need to pass in the recipient, subject and body from the form and it won't send what am I doing wrong?

emailForm.php

div id = "mail-create" class="col-6 border" style="display: none;">
      <h3 class="text-primary text-center">Send mail</h3>
      <form method="post" action="sendEmail.php">
        <input type="hidden" name="admin" value="1">
        <?php include('errors.php'); ?>
        <div class="form-group">
          <label for="firstname">Choose user</label>
          <select name="userEmail" id="userEmail">
            <?php foreach ($users as $user): ?>
              <option value="<?=$user['email'] ?>"><?=$user['username'] ?></option>
            <?php endforeach; ?>
          </select>
        </div>
        <div class="form-group" action="action.php">
          <label for="subject">Subject</label>
          <input type="text" class="form-control" name="subject" id="subject">
        </div>
        <div class="form-group">
          <label for="message">Message</label><br>
          <textarea name="message" id="message" cols="50" rows="8" placeholder="Write message body here"></textarea>
        </div>
        <button type="submit" name="sendMail" value="send" class="btn btn-primary mb-2">Send mail</button>
      </form>
    </div>  

sendEmail.php

<?php
 require 'vendor/autoload.php';
 use \Mailjet\Resources;
 if(isset($_POST[‘sendMail’]){
//passed in my actual api keys
   $mj = new \Mailjet\Client('MJ_APIKEY_PUBLIC','MJ_APIKEY_PRIVATE',true,['version' => 'v3.1']);
   $body = [
     'Messages' => [
       [
         'From' => [
           'Email' => "email@email.com",
           'Name' => "name"
         ],
         'To' => [
           [
             'Email' => $_POST['userEmail'],
             'Name' => "name"
           ]
         ],
         'Subject' => $_POST['userEmail'],
         'TextPart' => "My first Mailjet email",
         'HTMLPart' =>$_POST['message'],
         'CustomID' => "AppGettingStartedTest"
       ]
     ]
   ];
   $response = $mj->post(Resources::$Email, ['body' => $body]);
   $response->success() && var_dump($response->getData());
 }
 ?>


CakeEmail - Set multiple recipients

$
0
0

I have the next problem. I have been trying to put more than one recipient in a variable which I have set, but the mail is not triggered. I have tested this with just one recipient and it works. When I try to add one more, the email won't be sent. This is the first function that defines the sending of a simple email. This is located inside my AppController.php The email sending is done with the specified class CakeEmail.

   public function sendSimpleMail($to, $subject, $body, $to_copy = "") {
    $to = trim($to);
    $replay_to = EMAIL_REPLY;

    try {
        App::uses('CakeEmail', 'Network/Email');
        $email = new CakeEmail();
        if($to_copy == ""){
            $email->config('smtp')
            ->to($to)
            ->subject($subject)
            ->replyTo($replay_to)
            ->emailFormat('html');
        }
        else{
            $email->config('smtp')
            ->to($to)
            ->subject($subject)
            ->replyTo($replay_to)
            ->bcc($to_copy)
            ->emailFormat('html');
        }


        $email->send($body);
        return true;

    } catch (Exception $e) {
        $error = $e->getMessage();
        return $error;      
    }
}

Moreover, I am going to attach you the function where I prepare the email and send it to the recipients when the ajax request is trigerred through a form.

   public function wallet_request_ajax($email_callback){
    $this->autoRender = false;
    $d = $this->request->data;

    if(empty($d['date'])){
        return json_encode([
            'id' => 400,
            'txt' => __('Please, insert a date for the department to call you.')
        ]);
    }

    if(empty($d['time'])){
        return json_encode([
            'id' => 400,
            'txt' => __('Please specify an hour for the call.')
        ]);
    }

    if(empty($d['phone'])){
        return json_encode([
           'id' => 400,
            'txt' => __('Please, specify a phone number.')
        ]);
    }

    $existId = $this->Member->find('first', [
        'recursive' => -1,
        'fields' => ['id', 'name', 'surname'],
        'conditions' => [
            'md5(id)' => $d['id']
        ]
    ]);

    if(empty($existId)){
        return json_encode([
            'id' => 400,
            'txt' => __('Unexpected error. Contact with '. TELEPHONE) //TELEPHONE constant 

        ]);
    }
    $member_name = $existId['Member']['name'];
    $member_surname = $existId['Member']['surname'];
    $this->set(compact('member_name', 'member_surname'));
    $final_name = $member_name . "".$member_surname;**

    $this->loadModel('PhoneCall');
    $this->PhoneCall->create();
    if($this->PhoneCall->save([
        'phone' => $d['phone'],
        'id' => $existId['Member']['id'],
        'date' => date('Y-m-d', strtotime($d['date'])),
        'time' => $d['time']
    ])){
     // We send the email to 'customer care'
    if (PAIS === 'es'){   // if country is Spain 
        $to = "blabla12@hotmail.com, etc@gmail.com ,blabla@gmail.com"; // recipients
    } elseif(PAIS == 'it') {  // if country is Italy
        $to = "etc@gmail.com"; // recipients
    }elseif(PAIS === 'en'){ // if country is UK
        $to = "blabla12@hotmail.com"; // recipients
    }

    $subject = "Activation service";
    $body = "";
    $body .= "--------Notification of activation service";
    $body .= "-------<br>";
    if ($final_name !== "") {
        $body .= "<tr><td>Name: " . $final_name . "</td></tr><br>";
    }
    $body .= "----------------------------<br>";
    $body .= "<tr><td>Date: " . $d['date'] . "<br></td></tr>";
    $body .= "----------------------------<br>";
    $body .= "<tr><td>".__('Time'). ":" . $d['time'] . "<br></td></tr>";
    $body .= "----------------------------<br>";
    $body .= "<tr><td>Phone: " . $d['phone'] . "</td></tr><br>";
    $body .= "----------------------------<br>";
    $body .= "----------------------------<br>";
    $email_callback = $this->sendSimpleMail($to, $subject, $body);

    return json_encode([
        'id' => 200,
        'txt' => __('We will call you the specified time.')
    ]);

 }

If anyone of you out there has any thoughts as regards the matter, it would be really appreciating. I am kind of stuck as I want to try to include other recipients but unfortunately I think it must be some kind of compatibility with the CakeEmail class. Cheers

Send one report to each manager using VBA and Outlook

$
0
0

I have a list which contains:
- Clients - Manager e-mail
- Head manager e-mail

I'm trying to send e-mails using VBA and Outlook, in a way that each time the loop finds one manager (I'm checking for an e-mail address), it sends every client listed for that manager.

If a branch has no manager e-mail address listed, the e-mail should go to the Head Manager (branch 1236, for example, would receive one e-mail, to the Head Manager, with several clients).

The e-mail body will contain pre formatted text, and after that the sheet list with the client list.

I'm having some troubles:

a) to list the branch's clients from the sheet to the mail body
b) to jump from the next manager after the first e-mail, instead of repeating the e-mail for the same manager every time the loop finds the same manager
c) logging the mail sent on the J column

This is a sheet with some of the report: https://drive.google.com/file/d/1Qo-DceY8exXLVR7uts3YU6cKT_OOGJ21/view?usp=sharing

My loop works somewhat, but I believe I need some other approach to achieve this.

Private Sub CommandButton2_Click() 'envia o email com registro de log

    Dim OutlookApp As Object
    Dim emailformatado As Object
    Dim cell As Range
    Dim destinatario As String
    Dim comcopia As String
    Dim assunto As String
   'Dim body_ As String
    Dim anexo As String
    Dim corpodoemail As String
   'Dim publicoalvo As String

    Set OutlookApp = CreateObject("Outlook.Application")

   'Loop para verificar se o e-mail irá para o gerente da carteira ou para o gerente geral
    For Each cell In Sheets("publico").Range("H2:H2000").Cells

        If cell.Row <> 0 Then
            If cell.Value <> "" Then                   'Verifica se carteira possui gerente.
                destinatario = cell.Value              'Email do gerente da carteira.
            Else
                destinatario = cell.Offset(0, 1).Value 'Email do Gerente Geral.
            End If
            assunto = Sheets("CAPA").Range("F8").Value 'Assunto do e-mail, conforme CAPA.
           'publicoalvo = cell.Offset(0, 2).Value
           'body_ = Sheets("CAPA").Range("D2").Value
            corpodoemail = Sheets("CAPA").Range("F11").Value & "<br><br>"& _
            Sheets("CAPA").Range("F13").Value & "<br><br>"'& _
            Sheets("CAPA").Range("F7").Value & "<br><br><br>"'comcopia = cell.Offset(0, 3).Value         'Caso necessário, adaptar para enviar email com cópia.
           'anexo = cell.Offset(0, 4).Value            'Caso necessário, adaptar para incluir anexo ao email.

           'Montagem e envio dos emails.
            Set emailformatado = OutlookApp.CreateItem(0)
            With emailformatado
                .To = destinatario
               '.CC = comcopia
                .Subject = assunto
                .HTMLBody = corpodoemail '& publicoalvo
                '.Attachments.Add anexo
                '.Display
            End With
            emailformatado.Send
            Sheets("publico").Range("J2").Value = "enviado"
        End If
    Next

    With Application
        .EnableEvents = True
        .ScreenUpdating = True
    End With

    Set OutMail = Nothing
    Set OutApp = Nothing
End Sub

hiding images on email through media queries for hotmail

$
0
0

I'm developing an email with two images on mailjet, one img for desktop and the other for mobile, and although media queries work for outlook and gmail, i cant get them to work for hotmail. hotmail is showing both images regardless of screen size.

html:

<a href="#" style="text-decoration:none">
   <!--[if !mso]><!-->
     <img src="****" alt="" srcset="" width="600" style="-ms-interpolation-mode:bicubic;Mso-hide:all;border:none;clear:both;display:block;margin-left:auto;margin-right:auto;max-width:600px;outline:0;text-decoration:none;width:100%"                                              q="" class="imagenPrincipal" />
  <!--<![endif]-->
     <img src="*******" alt="" srcset="" width="600" style="-ms-interpolation-mode:bicubic;border:none;clear:both;display:block;margin-left:auto;margin-right:auto;max-width:600px;outline:0;text-decoration:none;width:100%"         q="" class="imagenPrincipalDesktop" /></a></td>

css:

 @media only screen and (max-width:500px) {
      .imagenPrincipalDesktop {
          display: none;
          max-height: 0;
          height:0;
      }
 }

@media only screen and (min-width:500px) {
     .imagenPrincipalDesktop {
         display: block;
         max-height: auto;
     }

     .imagenPrincipal {
        display: none;
        max-height: 0;
        mso-hide: all;
      }
 }

what am i doing wrong here?

PowerShell Send-MailMessage format column in message body

$
0
0

Warning - I'm new to PowerShell. There are two outcomes I would like to achieve with this script. The first is to include the output in an email and format the columns in the message body so they align with the headers similar to Out-Host. Second is when out-csv, out-gridview or export-excel, how do I order the columns?

$VolArray = @();


$Volumes = Get-Ncvol | Where-Object {$_.VolumeMirrorAttributes.IsDataProtectionMirror -match 'False' -and $_.VolumeStateAttributes.IsVserverRoot -match 'False' -and -not $_.VolumeCloneAttributes.VolumeCloneParentAttributes}
    ForEach ($Volume in $Volumes){
        #get properties
        $vol = Get-Ncvol $Volume
        #create object with values
        $volobj = New-Object -TypeName PSObject -Property @{
            'Controller' = $vol.NcController
            'Vserver' = $vol.Vserver
            'Aggregate' = $vol.VolumeIdAttributes.ContainingAggregateName 
            'Name' = $vol.VolumeIdAttributes.Name 
            'Type' = $vol.VolumeIdAttributes.Type 
            'TotSizeGB'= $vol.VolumeSpaceAttributes.Size/1gb
            'Used' = $vol.VolumeSpaceAttributes.SizeUsed/1gb
            '%Used' = $vol.VolumeSpaceAttributes.PercentageSizeUsed
            'AvailableGB' = $vol.VolumeSpaceAttributes.SizeAvailable/1gb
            'SSResSizeGB' = $vol.VolumeSpaceAttributes.SnapshotReserveSize/1GB 
            'IsDPMirror' = $vol.VolumeMirrorAttributes.IsDataProtectionMirror 
            'IsReplicaVol' = $vol.VolumeMirrorAttributes.IsReplicaVolume 
            'IsDPSource' = $vol.VolumeMirrorAttributes.IsSnapmirrorSource 
            'DPInProgress' = $vol.VolumeMirrorAttributes.MirrorTransferInProgress
            'SSPolicy' = $vol.VolumeSnapshotAttributes.SnapshotPolicy 
            'AutoSSEnabled' = $vol.VolumeSnapshotAttributes.AutoSnapshotsEnabled 
            'SSCount' = $vol.VolumeSnapshotAttributes.SnapshotCount
            '%SSReserve' = $vol.VolumeSpaceAttributes.PercentageSnapshotReserve 
            '%SSResUsed' = $vol.VolumeSpaceAttributes.PercentageSnapshotReserveUsed
            'SSSpaceUsed' = $vol.VolumeSpaceAttributes.SizeUsedBySnapshots/1GB;

        }
        #add to array outside opf for-loop
        $VolArray += $volobj

    } 


    #$VolArray | Export-Csv -Path c:\temp\file.csv
    #$VolArray | Export-Excel -Path c:\temp\exceldump.xlsx
    $VolArray | Out-String

#Send-MailMessage -To $mailto -Subject $subject -Body (-join $message) -Port $port -SmtpServer $smtp -from $emailfrom 
Send-MailMessage -To $mailto -Subject $subject -Port $port -SmtpServer $smtp -from $emailfrom -Attachments c:\temp\file.csv 

Message body: Message Body

base64 encoded images in email signatures

$
0
0

I have to include some images (company logo's etc) in email signatures. I've had all sorts of issues using the embedded images produced by the email system in question (they get sent as attachments generally) and as linked images (requiring permission to display them in the email received).

I have just seen some email from exchange that has a base64 image representation of the logo and uses a tag to do the displaying. I'm looking for some information on how I could do this in an email signature if possible (how do I generate the base64 version of the logo for a start and what code do I need to get it to work)?

I've tried simple things such as

<body>
<span>
<img src=.... >
</span>
</body>

but all I get is the alt text so I'm obviously doing something wrong here.

too many redirects php contact form

$
0
0

My website sayus there are too many redirects, it happens when you try to submit a form wich is to be mailed to a email. The link between the two is correct.

form code:

<section class="linksMain">
      <div class="form-style-5">
        <form action="../php/main/contact1.php" method="post">
        <fieldset>
          <legend>Personelijke informatie</legend>
          <input class="form" type="text" name="field1" placeholder="Je naam *">
          <input class="form" type="email" name="field2" placeholder="Je email *">
          <input class="form" type="text" name="field3" placeholder="Onderwerp">
          <label for="job">Categorie</label>
          <select id="job" name="field4">
              <option value="School">School</option>
              <option value="Stage">Stage</option>
              <option value="Media">Media INN</option>
              <option value="Copt">Copyright</option>
              <option value="Opdracht">Opdracht</option>
              <option value="Opdracht">VKG</option>
              <option value="Opdracht">Privé</option>
              <option value="other_indoor">Anders</option>
            </optgroup>
          </select>      
        </fieldset>
        <fieldset>
          <legend>Bericht</legend>
          <textarea class="form" name="field5" placeholder="Over jezelf"></textarea>
        </fieldset>
        <input type="submit" value="Verstuur" />
        </form>
      </div>    
    </section>

PHP code:

#This sends emails to inbox@driekvandermeulen.nl, the filler of the email comes from a form in main/contact.php

$name = $POST['field1'];
$email = $POST['field2'];
$subject = $POST['field3'];
$category = $POST['field4'];
$message = $POST['field5'];

$mailTo = "inbox@driekvandermeulen.nl";
$headers = "From:".$mailFrom;
$txt = "Je hebt een email gekregen van".$name.".\n\n".$message;

mail($mailTo, $subject, $category, $headers);
header("Location: contact1.php?mailsend");

Sending an email with Python

$
0
0

I am currently following a tutorial from codewithmosh.com. Now I am trying to send an email via Python. The problem is, that I get an error code, even if I typed it 1/1 like Mosh did. Not sure why this is happening.

from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
import smtplib

message = MIMEMultipart()
message["from"] = "myname"
message["to"] = "test@myname.de"
message["subject"] = "This is a test"
message.attach(MIMEText("Body"))

with smtplib.SMTP(host="mylogin.kasserver.com", port=587) as smtp:
    smtp.ehlo()
    smtp.starttls()
    smtp.login("hello@myname.de", "mypassword")
    smtp.send_message(message)
    print("Message sent...")

Due to privacy purposes I changed my domain-settings to "myname". I checked the password and login already, it is correct.

It gives me the following message:

Traceback (most recent call last): File "d:/Programmieren/app.py", line 15, in smtp.send_message(message) File "C:\Users\Ron\AppData\Local\Programs\Python\Python38-32\lib\smtplib.py", line 970, in send_message
return self.sendmail(from_addr, to_addrs, flatmsg, mail_options, File "C:\Users\Ron\AppData\Local\Programs\Python\Python38-32\lib\smtplib.py", line 885, in sendmail
raise SMTPRecipientsRefused(senderrs) smtplib.SMTPRecipientsRefused: {'test@myname.de': (504, b'5.5.2 : Sender address rejected: need fully-qualified address')}

Any idea why this is happening?

Thank you in advance for your help!


Python Sending Email with BCC instead of To

$
0
0

I'm working on a project to automate the types of emails I send everyday. The code below runs perfectly, but instead of sending the emails using the "To:" field, it defaults to the "BCC:" field.

My current code:

def no_ETA_email(df):
unique = list(df['Carrier'].unique())
for k in unique:
    df_email = df[df['Carrier'] == k]
    recipients = test[k]
    msg = MIMEMultipart()
    msg['Subject'] = "Tracking Updates Needed -- " + k
    msg['To']: recipients
    msg['From'] = 'EMAIL ADDRESS'

    html = """\
    <html>
      <head></head>
      <body>
      <p>
      Hi! </p>
      <p> Looks like we're missing ETAs for the following loads. </p> 
      <p> Do you mind going to our portal and updating them with times?</p> 
        {0}
      <p> If there are any issues, please let me know right away! </p>

      <p> We greatly appreciate having you as a carrier! </p>
      </body>
    </html>
    """.format(df_email.to_html())

    part1 = MIMEText(html, 'html')
    msg.attach(part1)

    server = smtplib.SMTP('smtp-mail.outlook.com', 587)
    server.starttls()
    server.login('USERNAME' , "PASSWORD")
    server.sendmail(msg['From'], recipients, msg.as_string())

As you can see below, the test email I used (from myself, to myself) includes the recipient in the BCC, not the To:

enter image description here

I have tried modifying the server.sendmail() code as follows:

server.sendmail(msg['From'], msg['To'], msg.as_string())

But this returns a None-type not iterable error.

Do you have any ideas of what might be causing this?

Kentico 9 Email Marketing

$
0
0

Whenever we send out a marketing email campaign, the emails seem to be sent out roughly every 3 minutes:

enter image description here

Where would I find the admin setting to increase this frequency to say every 5 seconds?

How to set a WooCommerce email template as default for all emails

$
0
0

I’m looking for a way to send all WordPress emails using a custom WooCommerce template so all emails will look the same.

The path to the template would be:

woocommerce/emails/my-custom-woocommerce-template.php

Example of sending an email with attachment via Amazon in Java

$
0
0

Does anyone have an example of sending an email, with an attachment, via Amazon SES (in Java)?

Capture the from ID while clicking mail signature from inbox

$
0
0

I want to capture from mail ID when the user click the link in the signature.

I will send the email to multiple user along with unsubscribe link in my signature.When the user click the unsubscribe link from signature and fill the from link redirected from the signature I want to capture the user mail Id.How can I capture the from ID from php.

I have added this link in the signature.

<a href="www.domain.com/testpject/unsubscribe/owner=myID@test.com&to=">unsubscribe</a>
Viewing all 29745 articles
Browse latest View live