Questions tagged [apex-email-service]

Email services are automated processes that use Apex classes to process the contents, headers, and attachments of inbound email.

Filter by
Sorted by
Tagged with
23
votes
1answer
57k views

Can anybody explain the UNABLE_TO_LOCK_ROW error?

Error Message: Developer script exception from Nicomatic : quotepotential : quotepotential: execution of AfterUpdate caused by: System.DmlException: Update failed. First exception on row 0 with ...
16
votes
2answers
1k views

How to use an Apex Email Service to store emails on a record EXACTLY as Salesforce does?

I have used the Lightning Experience UI to send an Email from a Record Homepage via Activity-Tab. This looks like this (bottom-right!): Now I want (vice versa) to store an incoming email received by ...
14
votes
1answer
18k views

How to get download link/url from attachment file in salesforce?

Hi I have one requirement where I am storing attachments in attachment object. After that I also want to update a custom url type field in some custom object . The value will be a direct link to ...
13
votes
4answers
10k views

How to test if outbound email is send

I have a batch that sends out an email notification to the triggering user when something went wrong. The code that does this is called from the finish() method. I'm now looking for an elegant way to ...
12
votes
3answers
27k views

Making regex case-insensitive

I have created some lines of code for an email handler that will scrape my emails for a particular string (STA0123). Code: // Find STA No. (in email body) Opportunity Opp = [SELECT id, STA_No__c ...
11
votes
2answers
19k views

How to Test Messaging.sendEmail

Looking for some help/advice in writing a test class. The class I need to test is an apex class to schedule a report that needs to be sent to an external email address once a month as a .csv ...
9
votes
1answer
710 views

Convert application/octet-stream in E-mail Processing class

Context: e-mails are sent with text attachments from a Dynamics SL/SQL Database to a Salesforce e-mail processor. The text attachments contain a formatted file with data to be processed and imported ...
9
votes
2answers
9k views

Send an email with apex with visualforce as email body

I have a visualforce page that I am trying to send from Apex code. I can't use a template for the e-mail and this visualforce page is never actually visited by anyone. I don't want the page to be ...
8
votes
2answers
1k views

Can't activate Email Service

I have created an email service based on the Salesforce documentation found at the following address: https://help.salesforce.com/apex/HTViewHelpDoc?id=code_email_services_editing.htm The only issue ...
8
votes
2answers
5k views

How to get the customer signature inside salesforce and generate the pdf?

We have a requirement for Customer Sign-up form. We have created a VF Tab and included VF page for creating Customer signup form. In that Customer Signup Form, we have a field to get the Customer ...
7
votes
1answer
163 views

What happens if I deactivate a User associated with an Email Service

Lets say I set up an Email Service running as a given context user. What happens if I then deactivate that user? Does the service continue running? Stop running? Do I get an error message? I ...
7
votes
2answers
3k views

How to unzip a zipfile attachment in apex and process each file in the zip attachment

I am trying to unzip a zip file attachment. but, unable to unzip the attachment and process all the internal files in the zip file. I want to do this using an email handler class.
6
votes
1answer
300 views

Email Service via Metadata API fails to create from Managed Package

As Email Services can't be packaged in a Managed Package, I allow subscribers to create it after the installation. The code which works in my packaging org fails in productions orgs with: An Apex ...
6
votes
1answer
480 views

how to hide salesforce email address?

I have a requirement where... my company works for different clients(like Orange, Apple, Avacado,etc.) and it's customers. We send requests and quotes to different customers on behalf of different ...
5
votes
2answers
13k views

Differences between email to case and on demand email to case

I haven't worked on configuring email to case before and there are basically two options. (Email to case and On demand email to case) I found a few links listing the differences in terms of ...
5
votes
4answers
7k views

Scraping text from email and storing in a field

I know that there is a web to lead form I can create to do something similar, but is there an easy way to get the inbound email address which can be monitored and the data from the email can be ...
5
votes
1answer
6k views

INVALID_ID_FIELD, WhatId is not available for sending emails to UserIds

I am trying to run below code in trigger. List<User> recipients = [SELECT id FROM User WHERE UserRoleId=:operationsRole.Id]; for (User usr:recipients) { Messaging.SingleEmailMessage ...
5
votes
1answer
351 views

Notification of Rejected Email

The documentation on governor limits states that: Email services rejects email messages and notifies the sender if the email (combined body text, body HTML and attachments) exceeds ...
5
votes
2answers
1k views

Not able to run trigger on “Send an Email”?

I wrote the below simple trigger for preventing Users from emailing as anything but the support account. I wrote this to work for the "Send an email" Task page (when sending an email to an Opp, Lead,...
5
votes
1answer
1k views

Scheduled Apex not consistantly executing, sending emails

I'm having a problem similar to this user's question from about a year ago, although it's not clear to me whether the solution provided there actually resolved the issue (or if it just made the ...
5
votes
1answer
495 views

Custom InboundEmail handler - check if message is an automatic reply

I've implemented a custom inbound email handler for some departments using email-to-case, and we would need to avoid autoreply messages or automatic generated messages to create cases or trigger other ...
4
votes
2answers
2k views

getContent() returns Blob PDF-body in console, but HTML page (rendered like PDF) in Email service code

First at all: Happy New Year to you and your family. I wish you all the best in new 2014 year. And about my case: I use 'MyPdfRenderingPage.getContent();' method to get Blob PDF-body, create PDF ...
4
votes
2answers
295 views

Do email results come in the same order as the list of emails

I populate a list of emails emailsToBeSent and send them all at once. However These emails are related to different sObjects. And to me it is important to know which sObject the returned results are ...
4
votes
3answers
8k views

Need to capture email reply in salesforce

I have a certain requirement. I need to capture email reply in Salesforce. Just take a scenario I have sent an email to one contact from send an email button from case related list. As soon as I send ...
4
votes
1answer
804 views

Not able to receive inbound emails from yahoo

I have created a email service and I have a inbound email class where I am inserting a contact when a email is received. When I send email from Gmail, rediffmail to my salesforce email service. I am ...
4
votes
1answer
165 views

'DataDotComEntitySetting' is not supported

I am writing a custom email service. I can get the incoming csv file and parse it down to rows and then columns. I do my thing, then I try to insert the objects (I know they are all original, the data ...
4
votes
1answer
604 views

custom Email Service - inline images appear as '[Image is no longer available]' upon Reply/ReplyAll

I recently completed a customized Email Service, to replace Email-To-Case, which handles duplicates by matching the incoming email subject with existing cases. As part of the InboundEmailHandler class,...
4
votes
1answer
2k views

Is it possible to send email on behalf of another user?

We have two salesforce users A and B with different profiles. B would like to send an email to our customer record in Salesforce but would like the email to be generated as if sent from A. Is this ...
4
votes
2answers
1k views

Accessing Outbound Mails

I would like to access the outbound emails sent from salesforce to the users(for eg. notification mail, scheduled reports mails etc). Could anyone tell me where those mails will be stored in the ...
4
votes
1answer
2k views

Inbound Email Service: Failed due to: SenderAuthorization

I'm developing an inbound email service to parse the email and create records in a custom object. This service was working fine in my developer org, but when I deployed this to a full sandbox for ...
4
votes
1answer
6k views

Salesforce Email are not received by recipient

I have a Salesforce org. Email address in Org is xxx.xxxx@domain.com and domain is a company name hosted on gmail. When I try to send email(Using apex or standard "Send email" button from objects) to ...
4
votes
2answers
80 views

Duplicate Lead creation from EmailService

I have an EmailService that takes the data from an email and creates a Lead if no match is found for the supplied email address. If a Lead is found then the Lead is updated with the new details ...
4
votes
0answers
2k views

Email To Case - Duplicate Cases

Have an interesting problem with Email To Case setup, scenario is User A sends an email to a support mailer and copys User B on it. Auto response would go to User A. If User B picks up the first email ...
3
votes
3answers
4k views

Salesforce Email Service Debugging

I have defined an email service which unfortunately isn't working. Is there a place I can monitor errors? The class doesn't appear in debug logs.
3
votes
1answer
154 views

Regex implementation in Salesforce: getting from known string to end of the line

I have an email service that parses an email and inserts or updates a set of fields. I have trawled through previous questions and can see that many regex posts are voted down for being not '...
3
votes
2answers
235 views

How to know current Email governor limits? [duplicate]

I am using SingleEmailMessage api for sending emails. I want to know the email limit quota usage, so that I can prevent further exceptions. Is there any way to know the quota usage in apex, so that I ...
3
votes
1answer
189 views

PDF file name issue in apex Send Mail method

I want to add date to a PDF file name. I am sending an email from apex and attaching one PDF file with it. Now I want to set string with dynamic date with it. E.g.... date fromdate = date....
3
votes
2answers
2k views

Gmail Forwarding Address verification code for Apex Email Service

I have written an Apex Email Service and would like to setup a rule in gmail to forward certain messages to the Email Service. The first step when creating a forwarding address in gmail is the ...
3
votes
2answers
3k views

See received emails in Activity History

Is there a way i can see all sent and received emails (related to a Case) in its "Activity History" Email-to-Case shows everything in Email related list. "Activity History" only shows the sent emails....
3
votes
1answer
3k views

Test class for sending email with Attachment

I need a test class for sending a email public blob body; public PageReference pdfmethod(){ try { // to get mail id Opportunity_Potential__c opp= [Select ...
3
votes
1answer
2k views

How to get values from a Messaging.Email object

I have code which builds a list of Messaging.Email objects to be sent out based on various conditions. The problem is I want to be able to write a test which asserts that these email factory methods I'...
3
votes
1answer
1k views

Newbie understanding Messaging.InboundEmailHandler interface

I'm writing an Inbound email handler class using Messaging.InboundEmailHandler interface. I'm following a tutorial from Jeff Douglas but can't find how you find out the structure of an interface? I ...
3
votes
2answers
353 views

Work out remaining singlemailmessage capacity in test

I have an Apex class that does some complicated decisions surrounding whether to send an e-mail to a user or not, including the fundamental "can we send any more e-mails today" check from Salesforce: ...
3
votes
1answer
855 views

What's the field name for “Send Apex Warning Emails” in User object?

I have a try/catch block in the start method of a batch class (which would go in to a managed package). If an exception is thrown, then I'd like to send an email from the catch block to system admin ...
3
votes
1answer
26 views

How do I access the full debug log for an managed email service Messaging.InboundEmailHandler?

I have a Messaging.InboundEmailHandler class that is packaged and distributed as part of a managed package. It is then configured against an Email Service in subscriber orgs. How can I access the ...
3
votes
1answer
7k views

Get Email Body with HTML Tags

I want to send an email in my logic. I have created an Email Template. Here is what I want to achieve: Email Template: <html width="600px"> <style>body{font-family:"Helvetica Neue",...
3
votes
1answer
37 views

Pulling PDF email attachment fields into Salesforce fields using Email Services

I am currently using Email Services as a way to have a customer's email update certain fields in a record relative to them (based on a customer ID# which is included in the subject of the email). ...
3
votes
0answers
125 views

The target object email address is currently marked as bounced

I have activated bounce management in two dev orgs. I am sending emails to record owner through batch class. If email is not valid, DEV1 org is throwing a message Email address is invalid and DEV2 org ...
3
votes
0answers
351 views

Email doesn't get sent even after changing the email address for error: The target object email address is currently marked as bounced

I am running into an issue when I want to send an email via apex. The problem happens occasionally only with some emails from some domains. The error in specific reports: Messaging.SendEmailError[...
3
votes
0answers
89 views

Does an Email Service accept Emails sent by phpmailer?

I have issues setting up an Email Service which should receive Email sent by an web-form using phpmailer. Now I've configured it like this: I've set no restriction to "Accept Email From" in order to ...

1 2 3 4 5 8