function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
krios demokrios demo 

How to add the sender in VF email template? can we mention sender as "abc@abc.com" in vf email template instead of "noreply@salesforce.com".

I have created the VF email template. It willl be sent to email Id when we click on button which is available on Opportunity. We user receive the email then there should be the sender as particular email Id instead of "noreply@salesforce.com". 

So how to mention the sender in vf Email Template?
SwethaSwetha (Salesforce Developers) 
HI Krios,
Can you try the approach mentioned in https://salesforce.stackexchange.com/questions/77021/i-need-to-change-from-email-in-visualforce-template

"

Once you have created an org-wide address grab the Id from the URL and use the setOrgWideEmailAddressId(Id) method on your instance of Messaging.SingleEmailMessage.

OrgWideEmailAddress[] owea = [select Id from OrgWideEmailAddress where Address = 'doNotReply@blahblah.com'];
    Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
    if ( owea.size() > 0 ) {
        mail.setOrgWideEmailAddressId(owea.get(0).Id);
    }

If this information helps, please mark the answer as best. Thank you